ETCD cluster installation

Source: Internet
Author: User
Tags etcd

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




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.