把刚才生成的证书拷贝到配置文件中的路径:
#cp /root/etcd/ca*pem server*pem /opt/etcd/ssl 将上面master节点所有生成的文件拷贝到node节点 scp -r /opt/etcd/ root@10.129.244.229:/opt/ scp /usr/lib/systemd/system/etcd.service root@10.129.244.229:/usr/lib/systemd/system/ 修改node节点中etcd.conf配置文件中的etcd_name和IP #[Member] ETCD_NAME="etcd02" # 修改此处,node改为etcd02 ETCD_DATA_DIR="/var/lib/etcd/default.etcd" ETCD_LISTEN_PEER_URLS="https://10.129.244.229:2380" # 修改此处为当前服务器 IP ETCD_LISTEN_CLIENT_URLS="https://10.129.244.229:2379" # 修改此处为当前服务器 IP #[Clustering] ETCD_INITIAL_ADVERTISE_PEER_URLS="https://10.129.244.229:2380" # 修改此处为当前服务器 IP ETCD_ADVERTISE_CLIENT_URLS="https://10.129.244.229:2379" # 修改此处为当前服务器 IP ETCD_INITIAL_CLUSTER="etcd01=https://10.129.246.114:2380,etcd02=https://10.129.244.229:2380" ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster" ETCD_INITIAL_CLUSTER_STATE="new" 启动etcd集群启动集群并设置开机自启动(先启动node节点在启动master节点同时进行)
#systemctl daemon-reload # systemctl start etcd # systemctl enable etcd 署完成检查etcd集群状态 #./etcdctl --ca-file=http://www.likecs.com/opt/etcd/ssl/ca.pem --cert-file=http://www.likecs.com/opt/etcd/ssl/server.pem --key114:2379,https://10.129.244.229:2379" cluster-health member 2ea4f7be04a16167 is healthy: got healthy result from https://10.129.246.114:2 member a849ee1eb498b9b2 is healthy: got healthy result from https://10.129.244.229:2 cluster is healthy #如果输出上面信息,就说明集群部署成功,如果有问题第一步先看日志:/var/log/message 或 journalctl -u etcd(如果提示timeout 则检查防火墙) node节点安装Docker未完。。。。。。。。。。。