请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

其中一台机器没问题,另一台再创建的时候出错了

####setup etcd cluster
在docker-node1上

#下载分布式工具
wget https://github.com/coreos/etcd/releases/download/v3.0.12/etcd-v3.0.12-linux-amd64.tar.gz
#解压
tar zxvf etcd-v3.0.12-linux-amd64.tar.gz
#进入解压文件内
cd etcd-v3.0.12-linux-amd64
#运行下面一大段指令,下面这段运行报错,代码应该是没有问题,应该是网络或者环境问题
nohup ./etcd --name docker-node1 --initial-advertise-peer-urls http://172.31.158.131:2380 \
--listen-peer-urls http://172.31.158.131:2380 \
--listen-client-urls http://172.31.158.131:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://172.31.158.131:2379 \
--initial-cluster-token etcd-cluster \
--initial-cluster docker-node1=http://172.31.158.131:2380,docker-node2=http://172.31.158.132:2380 \
--initial-cluster-state new&

在docker-node2上

#下载分布式工具
wget https://github.com/coreos/etcd/releases/download/v3.0.12/etcd-v3.0.12-linux-amd64.tar.gz
#解压
tar zxvf etcd-v3.0.12-linux-amd64.tar.gz
#进入解压文件内
cd etcd-v3.0.12-linux-amd64
#运行下面一大段指令
nohup ./etcd --name docker-node2 --initial-advertise-peer-urls http://172.31.158.132:2380 \
--listen-peer-urls http://172.31.158.132:2380 \
--listen-client-urls http://172.31.158.132:2379,http://127.0.0.1:2379 \
--advertise-client-urls http://172.31.158.132:2379 \
--initial-cluster-token etcd-cluster \
--initial-cluster docker-node1=http://172.31.158.131:2380,docker-node2=http://172.31.158.132:2380 \
--initial-cluster-state new&

node2没有问题,但是node1
运行就会自动退出求解

正在回答 回答被采纳积分+3

1回答

提问者 慕九州1544730 2018-09-12 18:40:15

node1现在是这样

```

./etcdctl cluster-health

cluster may be unhealthy: failed to list members

Error:  client: etcd cluster is unavailable or misconfigured

error #0: dial tcp 127.0.0.1:4001: getsockopt: connection refused

error #1: dial tcp 127.0.0.1:2379: getsockopt: connection refused

```

node2是这样

```

./etcdctl cluster-health

failed to check the health of member ba28710e7d78116c on http://172.31.158.131:2379: Get http://172.31.158.131:2379/health: dial tcp 172.31.158.131:2379: getsockopt: connection refused

member ba28710e7d78116c is unreachable: [http://172.31.158.131:2379] are all unreachable

member e3cff630f79fce28 is unhealthy: got unhealthy result from http://172.31.158.132:2379

cluster is unhealthy

```

0 回复 有任何疑惑可以回复我~
  • 提问者 慕九州1544730 #1
    不知道怎么会是,睡一觉重启机器,从头来一次又好了
    回复 有任何疑惑可以回复我~ 2018-09-12 21:15:08
  • 麦兜搞IT 回复 提问者 慕九州1544730 #2
    不知道是否是网络或者防火墙的问题
    回复 有任何疑惑可以回复我~ 2018-09-14 03:00:06
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信