etcd 群集centos7

etcd 群集centos7

##etcd 群集centos7
##############################################所有节点操作
yum
install -y etcd systemctl enable etcd echo " #[Member] ETCD_NAME=\"$(hostname)\" #ETCD_DATA_DIR=\"/var/lib/etcd/default.etcd\" ETCD_LISTEN_PEER_URLS=\"http://0.0.0.0:2380\" ETCD_LISTEN_CLIENT_URLS=\"http://0.0.0.0:2379\" #[Clustering] ETCD_INITIAL_ADVERTISE_PEER_URLS=\"http://$(ip addr |grep global |grep $(route |grep default |awk '{print $NF}') |head -n1 |awk '{print $2}' |cut -d '/' -f1):2380\" ETCD_ADVERTISE_CLIENT_URLS=\"http://$(ip addr |grep global |grep $(route |grep default |awk '{print $NF}') |head -n1 |awk '{print $2}' |cut -d '/' -f1):2379\" ETCD_INITIAL_CLUSTER=\"node223=http://192.168.3.223:2380,node224=http://192.168.3.224:2380,node225=http://192.168.3.225:2380\" ETCD_INITIAL_CLUSTER_TOKEN=\"k8s\" ETCD_INITIAL_CLUSTER_STATE=\"new\" " >/etc/etcd/etcd.conf systemctl restart etcd ########################################################################
###查看群集状态 etcdctl
-C http://k8smaster:2379 cluster-health ###查看群集节点信息 etcdctl -C http://k8smaster:2379 member list #

猜你喜欢

转载自www.cnblogs.com/blog-lhong/p/11946936.html