我一直按照这些说明在我的 Ubuntu 机器上设置一个 docker swarm。我想在运行 swarm 管理器的同一台机器上运行一些 swarm 节点,但是节点的状态是“Pending”,错误是“Cannot connect to the docker engine endpoint”。
这些是我运行来设置系统的命令:
docker run -d --name consul -p 8500:8500 progrium/consul -server -bootstrap
docker run --name manager -d -p 4000:4000 swarm manage -H :4000 --advertise 192.168.1.18:4000 consul://192.168.1.18:8500
docker run -d -p 6300:2375 swarm join --advertise=192.168.1.18:6300 consul://192.168.1.18:8500
我注意到的一件事是节点未绑定到端口:
$ nmap localhost
Starting Nmap 6.40 ( http://nmap.org ) at 2016-03-02 15:06 EST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00054s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 996 closed ports
PORT STATE SERVICE
4000/tcp open remoteanything
8500/tcp open fmtp
这是 docker info 的输出:
$ docker -H :4000 info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 0
Server Version: swarm/1.1.2
Role: primary
Strategy: spread
Filters: health, port, dependency, affinity, constraint
Nodes: 1
(unknown): 192.168.1.18:6300
└ Status: Pending
└ Containers: 0
└ Reserved CPUs: 0 / 0
└ Reserved Memory: 0 B / 0 B
└ Labels:
└ Error: Cannot connect to the docker engine endpoint
└ UpdatedAt: 2016-03-02T18:44:38Z
Plugins:
Volume:
Network:
Kernel Version: 4.2.0-30-generic
Operating System: linux
Architecture: amd64
CPUs: 0
Total Memory: 0 B
Name: 739dc6a5c721
任何帮助将不胜感激!