cari

Rumah  >  Soal Jawab  >  teks badan

docker+ swarm + etcd 集群的问题

环境信息

服务器:

集群信息:

准备

安装etcd k-v数据库

在centos-node1上执行:

export HOSTIP=192.168.99.100
docker run -d -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 \
 --name etcd ystyle/etcd \
 -name etcd0 \
 -advertise-client-urls http://${HOSTIP}:2379,http://${HOSTIP}:4001 \
 -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 \
 -initial-advertise-peer-urls http://${HOSTIP}:2380 \
 -listen-peer-urls http://0.0.0.0:2380 \
 -initial-cluster-token etcd-cluster-1 \
 -initial-cluster etcd0=http://${HOSTIP}:2380 \
 -initial-cluster-state new

分别在三个节点执行: 加入集群

docker run -d swarm join --addr=192.168.99.100:2375 etcd://192.168.99.100:2379/swarm
docker run -d swarm join --addr=192.168.99.101:2375 etcd://192.168.99.100:2379/swarm
docker run -d swarm join --addr=192.168.99.102:2375 etcd://192.168.99.100:2379/swarm

在centos-node2上启动swarm manage

dokcer run -d -p 2376:2375 swarm manage -H=0.0.0.0:2375 etcd://192.168.99.101:2379/swarm

然后发现不管用集群执行什么命令都没反应, 没有报错,pull不成功, images 里也是空的。

docker info 信息也很奇怪:

#docker -H tcp://192.168.99.101:2376 info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: swarm/1.1.3
Role: primary
Strategy: spread
Filters: health, port, dependency, affinity, constraint
Nodes: 2
 (unknown): 192.168.99.102:2375
  └ Status: Pending
  └ Containers: 0
  └ Reserved CPUs: 0 / 0
  └ Reserved Memory: 0 B / 0 B
  └ Labels: 
  └ Error: (none)
  └ UpdatedAt: 2016-03-16T14:14:30Z
 (unknown): 192.168.99.101:2375
  └ Status: Pending
  └ Containers: 0
  └ Reserved CPUs: 0 / 0
  └ Reserved Memory: 0 B / 0 B
  └ Labels: 
  └ Error: (none)
  └ UpdatedAt: 2016-03-16T14:14:30Z
Plugins: 
 Volume: 
 Network: 
Kernel Version: 3.10.0-327.10.1.el7.x86_64
Operating System: linux
Architecture: amd64
CPUs: 0
Total Memory: 0 B
Name: add02820f24f

swarm 节点只能看到两个

#docker run --rm swarm list etcd://192.168.99.100:2379/swarm
time="2016-03-16T14:19:41Z" level=info msg="Initializing discovery without TLS" 
192.168.99.101:2375
192.168.99.102:2375

这是怎么怎么回事? 还是我有步骤没做或漏了?

高洛峰高洛峰2775 hari yang lalu683

membalas semua(1)saya akan balas

  • ringa_lee

    ringa_lee2017-04-24 09:12:06

    Ia telah diselesaikan Masalah utama ialah port Hanya buka port di firewall Terdapat juga masalah id docker pendua Hanya padamkan fail /etc/docker/key.json 🎜>Sila rujuk proses pembinaan khusus Lihat

    balas
    0
  • Batalbalas