标签:position bin oca add clu listen 技术 执行 logs
1 # hostnamectl set-hostname etcd1.example.com 2 # hostnamectl set-hostname etcd2.example.com 3 # hostnamectl set-hostname etcd3.example.com 4 # vi /etc/hosts 5 #…… 6 172.24.8.71 etcd1.example.com 7 172.24.8.72 etcd2.example.com 8 172.24.8.73 etcd3.example.com
1 # ETCD_VER=v3.3.9 2 # GITHUB_URL=https://github.com/coreos/etcd/releases/download 3 # DOWNLOAD_URL=${GITHUB_URL} 4 # rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz 5 # rm -rf /tmp/etcd-download-test 6 # mkdir -p /tmp/etcd-download-test #创建下载保存目录 7 # curl -L ${DOWNLOAD_URL}/${ETCD_VER}/etcd-${ETCD_VER}-linux-amd64.tar.gz -o /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz 8 # tar xzvf /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz -C /tmp/etcd-download-test --strip-components=1 9 # cp /tmp/etcd-download-test/etcd /usr/local/bin/ 10 # cp /tmp/etcd-download-test/etcdctl /usr/local/bin/ 11 # rm -f /tmp/etcd-${ETCD_VER}-linux-amd64.tar.gz 12 13 # rm -rf /tmp/etcd-download-test/ 14 # ETCDCTL_API=3 15 # etcd --version 16 # etcdctl --version #查看已安装版本
1 # mkdir -p /var/log/etcd/ #建议创建etcd日志保存目录 2 # mkdir -p /data/etcd #建议创建单独的etcd数据目录
1 [root@etcd1 ~]# curl https://discovery.etcd.io/new?size=3 #使用公共etcd发现服务 2 https://discovery.etcd.io/c41a8c03922c32eaa4be1e7bcf6332a8
1 [root@etcd1 ~]# etcd --name etcd1 --data-dir /data/etcd 2 --initial-advertise-peer-urls http://172.24.8.71:2380 \ 3 --listen-peer-urls http://172.24.8.71:2380 \ 4 --listen-client-urls http://172.24.8.71:2379,http://127.0.0.1:2379 \ 5 --advertise-client-urls http://172.24.8.71:2379 \ 6 --discovery https://discovery.etcd.io/c41a8c03922c32eaa4be1e7bcf6332a8 7 8 [root@etcd2 ~]# etcd --name etcd2 --data-dir /data/etcd 9 --initial-advertise-peer-urls http://172.24.8.72:2380 \ 10 --listen-peer-urls http://172.24.8.72:2380 \ 11 --listen-client-urls http://172.24.8.72:2379,http://127.0.0.1:2379 \ 12 --advertise-client-urls http://172.24.8.72:2379 \ 13 --discovery https://discovery.etcd.io/c41a8c03922c32eaa4be1e7bcf6332a8 14 15 [root@etcd3 ~]# etcd --name etcd3 --data-dir /data/etcd 16 --initial-advertise-peer-urls http://172.24.8.73:2380 \ 17 --listen-peer-urls http://172.24.8.73:2380 \ 18 --listen-client-urls http://172.24.8.73:2379,http://127.0.0.1:2379 \ 19 --advertise-client-urls http://172.24.8.73:2379 \ 20 --discovery https://discovery.etcd.io/c41a8c03922c32eaa4be1e7bcf6332a8
1 [root@etcd1 ~]# etcdctl member list 2 [root@etcd1 ~]# etcdctl cluster-health
标签:position bin oca add clu listen 技术 执行 logs
原文地址:https://www.cnblogs.com/itzgr/p/9920861.html