On the node that will be a Swarm manager, use the following commands to open the necessary ports: Then enable it so that it starts on boot: So let’s enable it and add the network ports necessary for Docker Swarm to function. Method 1 - Open Docker Swarm Ports Using FirewallDįirewallD is the default firewall application on CentOS 7, but on a new CentOS 7 server, it is disabled out of the box. That’s because it’s assumed that you’re logged into the server using the docker-machine ssh command after provisioning it using Docker Machine. Note: You’ll notice that the commands (and all the commands in this article) are not prefixed with sudo.
![centos enable docker remote api centos enable docker remote api](https://img-blog.csdnimg.cn/2020092208555519.png)
#CENTOS ENABLE DOCKER REMOTE API HOW TO#
You can follow the tutorial How To Provision and Manage Remote Docker Hosts with Docker Machine on CentOS 7) to set these up. Set up the hosts that make up your cluster, including at least one swarm manager and one swarm worker.Prerequisitesīefore proceeding with this article, you should: While this tutorial covers both methods, each one delivers the same outcome, so you can choose the one you are most familiar with. FirewallD is the default firewall application on CentOS 7, but IPTables is also available. In this article, you’ll configure the Linux firewall on CentOS 7 using FirewallD and IPTables. Note: Aside from those ports, port 22 (for SSH traffic) and any other ports needed for specific services to run on the cluster have to be open. UDP port 4789 for overlay network traffic (container ingress networking).TCP and UDP port 7946 for communication among nodes (container network discovery).
![centos enable docker remote api centos enable docker remote api](https://docs.microsoft.com/en-us/windows/images/docker-wsl2.png)
It only needs to be opened on manager nodes. This port is used for communication between the nodes of a Docker Swarm or cluster.
![centos enable docker remote api centos enable docker remote api](https://campalus.com/content/images/size/w2000/2017/09/large_v-trans.png)
Docker Machine is used to orchestrate Docker hosts. This port is required for Docker Machine to work.