Rancher hosts setup on Centos7 machines.
- Setup firewalld rules for Centos on server
- only then startup the rancher server
- Setup firewalld rules for Centos on client
- only then startup the rancher server
first setup rancher server
docker run -d --restart=unless-stopped -p 8080:8080 rancher/server
on new centos host
yum update
curl -fsSL https://get.docker.com/ | sh
systemctl enable docker
systemctl start docker
systemctl status docker
[root@localhost ~]# firewall-cmd --zone=public --permanent --add-port=2378/tcp
success
[root@localhost ~]# firewall-cmd --zone=public --permanent --add-port=6379/tcp
success
[root@localhost ~]# firewall-cmd --zone=public --permanent --add-port=2888/tcp
success
[root@localhost ~]# firewall-cmd --zone=public --permanent --add-port=4500/udp
success
[root@localhost ~]# firewall-cmd --zone=public --permanent --add-port=500/udp
success
[root@localhost ~]# firewall-cmd --zone=public --permanent --add-port=2181/tcp
success
[root@localhost ~]# firewall-cmd --zone=public --permanent --add-port=3888/tcp
systemctl restart firewalld
the following ports are needed on both server and client
[root@localhost ~]# firewall-cmd --zone=public --list-ports
500/udp 3888/tcp 2181/tcp 4500/udp 2888/tcp 6379/tcp 2378/tcp
Some useful docker commands:
then paste in the command from rancher UI add Host
docker ps
docker stop $(docker ps -a -q)
docker rm$(docker ps -a -q)
try restart docker and restart firewall if cannot connect
No comments:
Post a Comment