gpt4 book ai didi

docker - 使用 “etcdctl member add”时,CoreOS成员节点将无法启动

转载 作者:行者123 更新时间:2023-12-02 18:24:09 24 4
gpt4 key购买 nike

我正在尝试使用命令“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

最佳答案

简而言之,您添加成员的步骤是错误的。
与官方的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

    关于docker - 使用 “etcdctl member add”时,CoreOS成员节点将无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37089387/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com