####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
运行就会自动退出求解