Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Cenots7 deployment etcd cluster

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Ip role 192.168.1.101master192.168.1.102

Node1192.168.1.103node2

1. Install etcd

Yum install-y etcd

two。 Configuration file

# master configure ETCD_NAME=etcdmaster ETCD_DATA_DIR= "/ var/lib/etcd/etcd-master.etcd" ETCD_LISTEN_PEER_URLS= "http://192.168.1.101:2380"ETCD_LISTEN_CLIENT_URLS="http://192.168.1.101:2379,http://127.0.0.1:2379"ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.1.101:2380"ETCD_INITIAL_CLUSTER="etcdmaster=http://192.168.1.101:2380, Etcdnode1= http://192.168.1.102:2380, Etcdnode2= http://192.168.1.103:2380"ETCD_INITIAL_CLUSTER_STATE="new"ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-00"ETCD_ADVERTISE_CLIENT_URLS="http://192.168.1.101:2379"# etcdnode01ETCD_NAME=etcdnode01ETCD_DATA_DIR= "/ var/lib/etcd/etcd-master.etcd" ETCD_LISTEN_PEER_URLS= "http://192.168.1.102:2380"ETCD_LISTEN_CLIENT_URLS="http://1092.168.1.102:2379, Http://127.0.0.1:2379"ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.6.74.6:2380"ETCD_INITIAL_CLUSTER="etcdmaster=http://192.168.1.101:2380,etcdnode1=http://192.168.1.102:2380, Etcdnode2= http://192.168.1.103:2380"ETCD_INITIAL_CLUSTER_STATE="new"ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-00"ETCD_ADVERTISE_CLIENT_URLS="http://192.168.1.102:2379"# etcdnode02ETCD_NAME=etcdnode02ETCD_DATA_DIR= "/ var/lib/etcd/etcd-master.etcd" ETCD_LISTEN_PEER_URLS= "http://192.168.1.103:2380"ETCD_LISTEN_CLIENT_URLS="http://192.168.1.103:2379, Http://127.0.0.1:2379"ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.1.103:2380"ETCD_INITIAL_CLUSTER="etcdmaster=http://192.168.1.101:2380,etcdnode1=http://192.168.1.102:2380,etcdnode2=http://192.168.1.103:2380"ETCD_INITIAL_CLUSTER_STATE="new"ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-00"ETCD_ADVERTISE_CLIENT_URLS="http://192.168.1.103:2379"

3. Configure startup command

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

[Unit] Description=Etcd ServerAfter=network.targetAfter=network-online.targetWants=network- online.target Type=notifyWorkingDirectory=/var/lib/etcd/EnvironmentFile=-/etc/etcd/etcd.confUser=etcdExecStart=/bin/bash-c "GOMAXPROCS=$ (nproc) / usr/bin/etcd-- name=\" ${ETCD_NAME}\ "\-- data-dir=\" ${ETCD_DATA_DIR}\ "\-- listen-peer-urls=\" ${ETCD_LISTEN_PEER_URLS}\ "--listen-client-urls=\" ${ETCD_LISTEN_CLIENT_URLS}\ "\-advertise-client-urls=\" ${ETCD_ADVERTISE_CLIENT_URLS}\ "\-initial-cluster-token=\" ${ETCD_INITIAL_CLUSTER_TOKEN}\ "\-initial-cluster=\" ${ETCD_INITIAL_CLUSTER}\ "\-initial-cluster-state=\" ${ETCD_INITIAL_CLUSTER_STATE}\ "Restart=on-failureLimitNOFILE=65536 [Install] WantedBy=multi-user.target

4. Administration and Management

Start various node systemctl start etcd respectively

# View Cluster status Command etcdctl member list

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report