New to buy notebook, reinstall ETCD, record it;
Three systems are centos7.3 virtual machines: IP addresses are: 192.168.23.128-130
Introduce a more clumsy way, suitable for beginners
Installation steps:
1) Yum Install-y Etcd
2 Modify the 9 parameters in the configuration file
Node1 node:
[Root@bxhvm01 ~]# grep-v "^#"/etc/etcd/etcd.conf etcd_name=etcd01 "etcd_data_dir="
etcd_listen_peer_urls= "http://192.168.23.128:2380"
etcd_listen_client_urls= "http://192.168.23.128:2379,http://127.0.0.1:2379"
etcd_initial_advertise_peer_ urls= "http://192.168.23.128:2380"
etcd_initial_cluster= "etcd01=http://192.168.23.128:2380,etcd02=http:// 192.168.23.129:2380,etcd03=http://192.168.23.130:2380 "
etcd_initial_cluster_state=" new "
ETCD_INITIAL_ Cluster_token= "etcd-cluster-00"
etcd_advertise_client_urls= "http://192.168.23.128:2379"
Node2 node:
[Root@bxhvm02 ~]# grep-v "^#"/etc/etcd/etcd.conf etcd_name=etcd02 "etcd_data_dir="
etcd_listen_peer_urls= "http://192.168.23.129:2380"
etcd_listen_client_urls= "http://192.168.23.129:2379,http://127.0.0.1:2379"
etcd_initial_advertise_peer_ urls= "http://192.168.23.129:2380"
etcd_initial_cluster= "etcd01=http://192.168.23.128:2380,etcd02=http:// 192.168.23.129:2380,etcd03=http://192.168.23.130:2380 "
etcd_initial_cluster_state=" new "
ETCD_INITIAL_ Cluster_token= "etcd-cluster-00"
etcd_advertise_client_urls= "http://192.168.23.129:2379"
NODE3 node:
[Root@bxhvm03 ~]# grep-v "^#"/etc/etcd/etcd.conf etcd_name=etcd03 "etcd_data_dir="
etcd_listen_peer_urls= "http://192.168.23.130:2380"
etcd_listen_client_urls= "http://192.168.23.130:2379,http://127.0.0.1:2379"
etcd_initial_advertise_peer_ urls= "http://192.168.23.130:2380"
etcd_initial_cluster= "etcd01=http://192.168.23.128:2380,etcd02=http:// 192.168.23.129:2380,etcd03=http://192.168.23.130:2380 "
etcd_initial_cluster_state=" new "
ETCD_INITIAL_ Cluster_token= "etcd-cluster-00"
etcd_advertise_client_urls= "http://192.168.23.130:2379"
3 After the configuration is complete, edit the file: Execstart part of Vim/usr/lib/systemd/system/etcd.service
Execstart=/bin/bash-c "gomaxprocs=$ (nproc)/usr/bin/etcd--name=\" ${etcd_name}\ "--data-dir=\" ${ETCD_DATA_DIR}\ "
--listen-client-urls=\ "${etcd_listen_client_urls}\"
--advertise-client-urls=\ "${etcd_advertise_client_urls}\"
--initial-cluster=\ "${etcd_initial_cluster}\" --initial-cluster-state=\ "${etcd_initial_cluster_state}\" "
4) Shutdown firewall
Systemctl Stop firewalld
systemctl disable FIREWALLD
5) Restart Etcd
Systemctl daemon-reload
systemctl Restart ETCD
6) Confirm Etcd normal operation
[ROOT@BXHVM01 ~]# etcdctl member list
55f302e63e1512d6:name=etcd03 peerurls=http://192.168.23.130:2380 clienturls=http://192.168.23.130:2379 isleader=true
9d319d1404567e7c:name=etcd01 peerURLs=http:// 192.168.23.128:2380 clienturls=http://192.168.23.128:2379 isleader=false
a29cf32d55bf9ea2:name=etcd02 peerurls=http://192.168.23.129:2380 clienturls=http://192.168.23.129:2379 Isleader=false
[Root@bxhvm01 ~]# etcdctl cluster-health member
55F302E63E1512D6 are healthy:got healthy result from http://192.168.2 3.130:2379 member
9d319d1404567e7c are healthy:got healthy result from http://192.168.23.128:2379
A29CF32D55BF9EA2 is Healthy:got healthy result from http://192.168.23.129:2379