[Service]
Type=notify
WorkingDirectory=/data/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-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-failure
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start etcd
相同配置,部署其他2个minion
使用命令查看集群是否工作正常,健康状态
[root@kuber-minion-131 etcd131]# etcdctl cluster-health
member 20f418ed55efe527 is healthy: got healthy result from
member 6b960ae0c1de1041 is healthy: got healthy result from
member a650fa2f39310524 is healthy: got healthy result from
cluster is healthy
[root@kuber-minion-131 etcd131]# etcdctl member list
20f418ed55efe527: name=etcd63 peerURLs= clientURLs= isLeader=false
6b960ae0c1de1041: name=etcd131 peerURLs= clientURLs= isLeader=false
a650fa2f39310524: name=etcd60 peerURLs= clientURLs= isLeader=true