可以再任意节点执行swarm list 命令查看集群的节点列表
root@docker-1:~# docker run --rm swarm list token://1081dc3745b8dfd45ff863c13d74d96c
192.168.1.193:2375
192.168.1.195:2375
192.168.1.194:2375
root@docker-2:~# docker run --rm swarm list token://1081dc3745b8dfd45ff863c13d74d96c
192.168.1.193:2375
192.168.1.195:2375
192.168.1.194:2375
可以再任意节点可以创建集群容器,如docker-3
root@docker-3:~# docker -H 192.168.1.193:12375 run -d CentOS ping
41ca94b3da41767ecd87de7d37a3611141dc8b36aad52211b75374b153628312
查看集群所有节点运行的容器
root@docker-3:~# docker -H 192.168.1.193:12375 ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
41ca94b3da41 centos "ping " 3 minutes ago Up 3 minutes docker-2/vigilant_bose
查看集群所有节点的容器
root@docker-3:~# docker -H 192.168.1.193:12375 ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
41ca94b3da41 centos "ping " 3 minutes ago Up 3 minutes docker-2/vigilant_bose
ad81e842302d swarm "/swarm manage tok..." 13 minutes ago Up 13 minutes 192.168.1.193:12375->2375/tcp docker-1/hungry_benz
1b62af7b1ecf swarm "/swarm join --add..." 30 minutes ago Up 30 minutes 2375/tcp docker-3/ecstatic_elion
b88ab2e5eb4e swarm "/swarm join --add..." 30 minutes ago Up 30 minutes 2375/tcp docker-2/romantic_poincare
fbc0c47268e1 swarm "/swarm join --add..." 32 minutes ago Up 32 minutes 2375/tcp docker-1/competent_benz
查看本节点docker-3 正在运行的容器
root@docker-3:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1b62af7b1ecf swarm "/swarm join --add..." 31 minutes ago Up 31 minutes 2375/tcp ecstatic_elion
查看本节点docker-3 的所有容器
root@docker-3:~# docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1b62af7b1ecf swarm "/swarm join --add..." 31 minutes ago Up 31 minutes 2375/tcp ecstatic_elion
root@docker-3:~#
在docker-1主机上分别执行节点和集群的docker info看看,可以对比一下