标签:-- init pac user 创建用户 pre int code 进制
下载etcd 二进制安装包。
https://github.com/etcd-io/etcd/releases
创建用户和相关目录
mkdir –p /home/etcd/data/node1
mkdir –p /home/etcd/data/node2
mkdir –p /home/etcd/data/node3
useradd -d /home/etcd etcd
su - etcd
启动3个节点
./etcd -name node1 -data-dir ../data/node1 -initial-advertise-peer-urls ‘http://10.21.88.225:9001‘ --listen-peer-urls ‘http://10.21.88.225:9001‘ -advertise-client-urls ‘http://10.21.88.225:9002‘ --listen-client-urls ‘http://10.21.88.225:9002‘ --auto-compaction-retention=1 -initial-cluster-token etcd-cluster-1 -initial-cluster node1=http://10.21.88.225:9001,node2=http://10.21.88.225:9003,node3=http://10.21.88.225:9005 -initial-cluster-state new >> /home/etcd/node1.log 2>&1 &
./etcd -name node2 -data-dir ../data/node2 -initial-advertise-peer-urls ‘http://10.21.88.225:9003‘ --listen-peer-urls ‘http://10.21.88.225:9003‘ -advertise-client-urls ‘http://10.21.88.225:9004‘ --listen-client-urls ‘http://10.21.88.225:9004‘ --auto-compaction-retention=1 -initial-cluster-token etcd-cluster-1 -initial-cluster node1=http://10.21.88.225:9001,node2=http://10.21.88.225:9003,node3=http://10.21.88.225:9005 -initial-cluster-state new >> /home/etcd/node2.log 2>&1 &
./etcd -name node3 -data-dir ../data/node3 -initial-advertise-peer-urls ‘http://10.21.88.225:9005‘ --listen-peer-urls ‘http://10.21.88.225:9005‘ -advertise-client-urls ‘http://10.21.88.225:9006‘ --listen-client-urls ‘http://10.21.88.225:9006‘ --auto-compaction-retention=1 -initial-cluster-token etcd-cluster-1 -initial-cluster node1=http://10.21.88.225:9001,node2=http://10.21.88.225:9003,node3=http://10.21.88.225:9005 -initial-cluster-state new >> /home/etcd/node3.log 2>&1 &
查看集群状态
./etcdctl --endpoints http://10.21.88.225:9002,http://10.21.88.225:9004,http://10.21.88.225:9006 member list
标签:-- init pac user 创建用户 pre int code 进制
原文地址:https://www.cnblogs.com/abcyrf/p/10064501.html