Portainer add Docker node information

Disclaimer: This article is a blogger original article, shall not be reproduced without the bloggers allowed. https://blog.csdn.net/bj_chengrong/article/details/90300972

1, the configuration daemon.json (server)

Detecting whether the node is available: docker -H 10.8.200.133 info

-------------------------------------------------- ---------------------------- the following is the client machine to perform docker:

Docker node are mounted on the master. Also, more than one node and so on.

2375 open ports on the node, the command is as follows:

echo "OPTIONS='-Htcp://0.0.0.0:2375 -H unix:///var/run/docker.sock'"  (这里是在客户端机器执行)

/etc/sysconfig/docker (这里是在客户端机器执行)

Insufficient permissions to perform: chmod 777 /etc/sysconfig/docker

再执行:/etc/sysconfig/docker

Adding key-value pairs in the /etc/docker/daemon.json

Each server only add their own IP information, such as current server IP is: 10.8.200.202, then add the following information

{
"hosts": ["tcp://10.8.200.202:2375", "unix:///var/run/docker.sock"]
}


1.2, before restarting Docker Docker selected closed container

$ docker ps // 查看所有正在运行容器
$ docker stop containerId // containerId 是容器的ID

$ docker ps -a // 查看所有容器
$ docker ps -a -q // 查看所有容器ID

$ docker stop $(docker ps -a -q) //  stop停止所有容器
$ docker  rm $(docker ps -a -q) //   remove删除所有容器


$ docker images //查看PULL的镜像ID
$ docker  rmi [image-id] //   删除对应的镜像文件

 

1.3, restart Docker
systemctl restart Docker

1.4, see Docker running state

service docker status

2. open port 2375 (server)

2.1, add port (open firewall ports)

firewall-cmd --permanent --zone=public --add-port=2375/tcp

firewall-cmd --reload

2.2, view the current firewall has open / filtered ports

firewall-cmd --permanent --zone=public --list-ports

2.3, turn off the firewall

systemctl stop firewalld.service 

2.4, open the firewall command

systemctl start firewalld.service 

systemctl status firewalld  --查看防火墙状态;
systemctl start firewalld   --开启防火墙
systemctl stop firewalld    -- 关闭防火墙

 

docker -H 192.168.1.248 info

 

 

Guess you like

Origin blog.csdn.net/bj_chengrong/article/details/90300972