标签:工具 NPU ffffff 51cto 使用 复制 eal 重命名 图片
挺不喜欢讲原理的东西的,自己看书比谁讲的都好,贴一个集群的图共理解。配置etcd的配置文件 (多机器配置,此处我列出来两台机器的。)
vi /root/etcd/conf.yml
集群一配置
name: etcd-1
data-dir: /root/etcd/data
listen-client-urls: http://0.0.0.0:2379
advertise-client-urls: http://172.16.27.133:2379
listen-peer-urls:? http://0.0.0.0:2380
initial-advertise-peer-urls: http://172.16.27.133:2380
initial-cluster: etcd-1=http://172.16.27.133:2380,etcd-2=http://172.16.27.134:2380
initial-cluster-token: etcd-cluster-token
initial-cluster-state: new
或者直接使用主机名称配置
name: etcd-1
data-dir: /root/etcd/data
listen-client-urls: http://0.0.0.0:2379
advertise-client-urls: http://docker3:2379
listen-peer-urls:? http://0.0.0.0:2380
initial-advertise-peer-urls: http://docker3:2380
initial-cluster: etcd-1=http://docker3:2380,etcd-2=http://docker4:2380
initial-cluster-token: etcd-cluster-token
initial-cluster-state: new
集群二配置
name: etcd-2
data-dir: /root/etcd/data
listen-client-urls: http://0.0.0.0:2379
advertise-client-urls: http://172.16.27.134:2379
listen-peer-urls:? http://0.0.0.0:2380
initial-advertise-peer-urls: http://172.16.27.134:2380
initial-cluster: etcd-1=http://172.16.27.133:2380,etcd-2=http://172.16.27.134:2380
initial-cluster-token: etcd-cluster-token
initial-cluster-state: new
启动etcd
两台机器分别执行
nohup etcd --config-file=/root/etcd/conf.yml >/root/etcd/etcd.log 2>&1 &
可以将启动etcd脚本加到开机启动项就不用每次启动。
3.测试etcd的安装状态
查看etcd成员信息
etcdctl member list
查看etcd集群状态是否正常
etcdctl cluster-health
未完待续
标签:工具 NPU ffffff 51cto 使用 复制 eal 重命名 图片
原文地址:http://blog.51cto.com/zhanglele/2349791