我正在尝试使用命令“etcdctl member add core2 http://172.31.12.183:2380”向我的CoreOS群集添加一个额外的etcd节点,但是这个命令使我的新节点没有启动,因此我的群集不健康。在运行etcdctl member add命令后,如何解决此问题或启动新节点?以下是我运行此命令时的输出以及之后的集群状态:
core@ip-172-31-12-183 ~ $ etcdctl member add core2 http://172.31.12.183:2380
Added member named core2 with ID 4d14f3cb088a2f54 to cluster
ETCD_NAME="core2"
ETCD_INITIAL_CLUSTER="core2=http://172.31.12.183:2380,ec2c8c9d2cf141cf9657e98b260895a5=http://172.31.12.182:2380"
ETCD_INITIAL_CLUSTER_STATE="existing"
core@ip-172-31-12-183 ~ $ etcdctl member list
4d14f3cb088a2f54[unstarted]: peerURLs=http://172.31.12.183:2380
aedf0a441a723d8a: name=ec2c8c9d2cf141cf9657e98b260895a5 peerURLs=http://172.31.12.182:2380 clientURLs=http://172.31.12.182:2379,http://172.31.12.182:4001
core@ip-172-31-12-183 ~ $ etcdctl cluster-health
member 4d14f3cb088a2f54 is unreachable: no available published client urls
member aedf0a441a723d8a is unhealthy: got unhealthy result from http://172.31.12.182:2379
cluster is unhealthy
答案 0 :(得分:1)
简单地说,您添加成员的步骤是错误的。
与官方docs一样,我假设add a new member to a 1-node cluster
的步骤是您的方案:
etcdctl member add
所以根据你的情况:
在core2
开始之前,运行=>
etcdctl member add core2 http://172.31.12.183:2380
然后,使用与群集相关的选项启动core2
=>
./etcd --name core2 --initial-advertise-peer-urls http://172.31.12.183:2380 \
--listen-peer-urls http://172.31.12.183:2380 \
--listen-client-urls http://172.31.12.183:2379 \
--advertise-client-urls http://172.31.12.183:2379 \
--initial-cluster core2=http://172.31.12.183:2380,ec2c8c9d2cf141cf9657e98b260895a5=http://172.31.12.182:2380 \
--initial-cluster-state existing