--ETCD cluster construction of "Seven wounds fist" of Jin Yong's martial arts

Source: Internet
Author: User
Tags etcd

Environment :

etcd01:192.168.93.201,centos7.2

etcd02:192.168.93.203,centos7.2

etcd03:192.168.93.203,centos7.2

Software version:

etcd:2.3.7


Implementation steps:

With ETCD1 deployment as an example, the other 2 host steps are the same:


Installing ETCD

[email protected] ~]# Yum install etcd-y


Modifying a configuration file

Vi/etc/etcd//etcd.conf


Etcd_name=etcd01


Etcd_data_dir= "/VAR/LIB/ETCD/ETCD01"


Etcd_listen_peer_urls= "http://192.168.93.201:2380"


Etcd_listen_client_urls= "http://192.168.93.201:2379,http://127.0.0.1:2379"


Etcd_initial_advertise_peer_urls= "http://192.168.93.201:2380"


Etcd_initial_cluster= "etcd01=http://192.168.93.201:2380,etcd02=http://192.168.93.202:2380,etcd03=http:// 192.168.93.203:2380 "


Etcd_initial_cluster_state= "New"


Etcd_initial_cluster_token= "etcd-cluster-00"


Etcd_advertise_client_urls= "http://192.168.93.201:2379"


###########################################################################

Etcd_name=etcd02


Etcd_data_dir= "/VAR/LIB/ETCD/ETCD01"


Etcd_listen_peer_urls= "http://192.168.93.202:2380"


Etcd_listen_client_urls= "http://192.168.93.202:2379,http://127.0.0.1:2379"


Etcd_initial_advertise_peer_urls= "http://192.168.93.202:2380"


Etcd_initial_cluster= "etcd01=http://192.168.93.201:2380,etcd02=http://192.168.93.202:2380,etcd03=http:// 192.168.93.203:2380 "


Etcd_initial_cluster_state= "New"


Etcd_initial_cluster_token= "etcd-cluster-00"


Etcd_advertise_client_urls= "http://192.168.93.202:2379"



####################################################################


Etcd_name=etcd03


Etcd_data_dir= "/VAR/LIB/ETCD/ETCD01"


Etcd_listen_peer_urls= "http://192.168.93.203:2380"


Etcd_listen_client_urls= "http://192.168.93.203:2379,http://127.0.0.1:2379"


Etcd_initial_advertise_peer_urls= "http://192.168.93.203:2380"


Etcd_initial_cluster= "etcd01=http://192.168.93.201:2380,etcd02=http://192.168.93.202:2380,etcd03=http:// 192.168.93.203:2380 "


Etcd_initial_cluster_state= "New"


Etcd_initial_cluster_token= "etcd-cluster-00"


Etcd_advertise_client_urls= "http://192.168.93.203:2379"


##################################################################################


Be careful not to make the cluster stop because you are copying less content



Confirm Etcd Startup file


Less/usr/lib/systemd/system/etcd.service


[Unit]

Description=etcd Server

After=network.target

After=network-online.target

Wants=network-online.target


[Service]

Type=notify

workingdirectory=/var/lib/etcd/

Environmentfile=-/etc/etcd/etcd.conf

User=etcd

# set Gomaxprocs to number of processors

Execstart=/bin/bash-c "gomaxprocs=$ (nproc)/usr/bin/etcd--name=\" ${etcd_name}\ "--data-dir=\" ${ETCD_DATA_DIR}\ "-- Listen-client-urls=\ "${etcd_listen_client_urls}\" "

Restart=on-failure

limitnofile=65536


[Install]

Wantedby=multi-user.target



Update Startup:

Systemctl daemon-reloadsystemctl start Etcdsystemctl enable ETCD



Check Status:


ETCDCTL member List Etcdctl cluster-health








Jin Yong Martial arts "seven wounds fist"--ETCD cluster construction

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.