00-ETCD安装配置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了00-ETCD安装配置相关的知识,希望对你有一定的参考价值。

1. 环境信息:CentOS 7.3 最小化安装

node50 192.168.1.50;node51 192.168.1.51;node52 192.168.1.52

2. yum安装etcd:

[[email protected] ~]# yum install etcd

技术分享

3. 编辑etcd配置文件:

[[email protected] ~]# vi /etc/etcd/etcd.conf

4. 各节点配置如下:

node51:

ETCD_NAME=etcd01
ETCD_DATA_DIR="/var/lib/etcd/etcd01.etcd"
ETCD_LISTEN_PEER_URLS="http://192.168.1.51:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.1.51:2379,http://127.0.0.1:2379"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.1.51:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.1.51:2379"
ETCD_INITIAL_CLUSTER_STATE="new"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster1"
ETCD_INITIAL_CLUSTER="etcd01=http://192.168.1.51:2380,etcd02=http://192.168.1.50:2380,etcd03=http://192.168.1.52:2380"

node50:

ETCD_NAME=etcd02
ETCD_DATA_DIR="/var/lib/etcd/etcd02.etcd"
ETCD_LISTEN_PEER_URLS="http://192.168.1.50:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.1.50:2379,http://127.0.0.1:2379"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.1.50:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.1.50:2379"
ETCD_INITIAL_CLUSTER_STATE="new"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster1"
ETCD_INITIAL_CLUSTER="etcd01=http://192.168.1.51:2380,etcd02=http://192.168.1.50:2380,etcd03=http://192.168.1.52:2380"

node52:

ETCD_NAME=etcd03
ETCD_DATA_DIR="/var/lib/etcd/etcd03.etcd"
ETCD_LISTEN_PEER_URLS="http://192.168.1.52:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.168.1.52:2379,http://127.0.0.1:2379"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.1.52:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.1.52:2379"
ETCD_INITIAL_CLUSTER_STATE="new"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster1"
ETCD_INITIAL_CLUSTER="etcd01=http://192.168.1.51:2380,etcd02=http://192.168.1.50:2380,etcd03=http://192.168.1.52:2380"

5. 分别在三个节点更新配置,设置开机自启动,启动etcd服务:

[[email protected] ~]# systemctl daemon-reload

[[email protected] ~]# systemctl start etcd

[[email protected] ~]# systemctl enable etcd

6. 验证:

[[email protected] ~]# etcd

技术分享

[[email protected] ~]# etcdctl member list

技术分享

 

























以上是关于00-ETCD安装配置的主要内容,如果未能解决你的问题,请参考以下文章

如何安装配置JIRA和CONFLUENCE WIKI

如何安装配置JIRA和CONFLUENCE WIKI

Nginx怎么安装配置

Privoxy 安装配置

如何安装配置Apache中的mod

如何安装和配置 Azure PowerShell