您好,登录后才能下订单哦!
这篇文章主要讲解了“centos7.6下部署ETCD3.4.7 集群的详细步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“centos7.6下部署ETCD3.4.7 集群的详细步骤”吧!
https://github.com/etcd-io/etcd/releases
tar -xvf etcd-v3.4.7-linux-amd64.tar.gz cd etcd-v3.4.7-linux-amd64 cp etcd etcdctl /k8s/etcd/bin/
cat /k8s/etcd/cfg/etcd #[Member] ETCD_NAME="etcd01" ETCD_DATA_DIR="/var/lib/etcd/default.etcd" ETCD_LISTEN_PEER_URLS="https://192.168.2.88:2380" ETCD_LISTEN_CLIENT_URLS="https://192.168.2.88:2379" #[Clustering] ETCD_INITIAL_ADVERTISE_PEER_URLS="https://192.168.2.88:2380" ETCD_ADVERTISE_CLIENT_URLS="https://192.168.2.88:2379" ETCD_INITIAL_CLUSTER="etcd01=https://192.168.2.88:2380,etcd02=https://192.168.2.81:2380,etcd03=https://192.168.2.82:2380" ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
cat /usr/lib/systemd/system/etcd.service
[Unit] Description=Etcd Server After=network.target After=network-online.target Wants=network-online.target [Service] Type=notify EnvironmentFile=/k8s/etcd/cfg/etcd ExecStart=/k8s/etcd/bin/etcd \ --initial-cluster-state=new \ --cert-file=/k8s/etcd/ssl/server.pem \ --key-file=/k8s/etcd/ssl/server-key.pem \ --peer-cert-file=/k8s/etcd/ssl/server.pem \ --peer-key-file=/k8s/etcd/ssl/server-key.pem \ --trusted-ca-file=/k8s/etcd/ssl/ca.pem \ --peer-trusted-ca-file=/k8s/etcd/ssl/ca.pem Restart=on-failure LimitNOFILE=65536 [Install] WantedBy=multi-user.target
systemctl daemon-reload systemctl enable etcd systemctl start etcd
systemctl status etcd ● etcd.service - Etcd Server Loaded: loaded (/usr/lib/systemd/system/etcd.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2019-07-09 15:55:58 CST; 1h 12min ago Main PID: 29830 (etcd) Tasks: 12 Memory: 66.7M CGroup: /system.slice/etcd.service └─29830 /k8s/etcd/bin/etcd --name=etcd01 --data-dir=/var/lib/etcd/default.etcd --listen-peer-urls=https://192.168.1.10... Jul 09 17:07:39 qas-k8s-master01 etcd[29830]: the clock difference against peer 2369b1ebd5f356e7 is too high [1.340843978s ...SAGE") Jul 09 17:07:39 qas-k8s-master01 etcd[29830]: the clock difference against peer 2369b1ebd5f356e7 is too high [1.343013157s ...SHOT") Jul 09 17:08:04 qas-k8s-master01 etcd[29830]: the clock difference against peer 67ad1178efd89256 is too high [1.287315582s ...SHOT") Jul 09 17:08:04 qas-k8s-master01 etcd[29830]: the clock difference against peer 67ad1178efd89256 is too high [1.285244104s ...SAGE") Jul 09 17:08:09 qas-k8s-master01 etcd[29830]: the clock difference against peer 2369b1ebd5f356e7 is too high [1.340602239s ...SAGE") Jul 09 17:08:09 qas-k8s-master01 etcd[29830]: the clock difference against peer 2369b1ebd5f356e7 is too high [1.342891162s ...SHOT") Jul 09 17:08:34 qas-k8s-master01 etcd[29830]: the clock difference against peer 67ad1178efd89256 is too high [1.285259365s ...SAGE") Jul 09 17:08:34 qas-k8s-master01 etcd[29830]: the clock difference against peer 67ad1178efd89256 is too high [1.287337806s ...SHOT") Jul 09 17:08:39 qas-k8s-master01 etcd[29830]: the clock difference against peer 2369b1ebd5f356e7 is too high [1.342999378s ...SHOT") Jul 09 17:08:39 qas-k8s-master01 etcd[29830]: the clock difference against peer 2369b1ebd5f356e7 is too high [1.339802949s ...SAGE") Hint: Some lines were ellipsized, use -l to show in full.
cd /k8s/ scp -r etcd 192.168.2.81:/k8s/ scp -r etcd 192.168.2.82:/k8s/ scp /usr/lib/systemd/system/etcd.service 192.168.2.81:/usr/lib/systemd/system/etcd.service scp /usr/lib/systemd/system/etcd.service 192.168.2.82:/usr/lib/systemd/system/etcd.service
cat /k8s/etcd/cfg/etcd
#[Member] ETCD_NAME="etcd02" ETCD_DATA_DIR="/var/lib/etcd/default.etcd" ETCD_LISTEN_PEER_URLS="https://192.168.2.81:2380" ETCD_LISTEN_CLIENT_URLS="https://192.168.2.81:2379" #[Clustering] ETCD_INITIAL_ADVERTISE_PEER_URLS="https://192.168.2.81:2380" ETCD_ADVERTISE_CLIENT_URLS="https://192.168.2.81:2379" ETCD_INITIAL_CLUSTER="etcd01=https://192.168.2.88:2380,etcd02=https://192.168.2.81:2380,etcd03=https://192.168.2.82:2380" ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
cat /k8s/etcd/cfg/etcd
#[Member] ETCD_NAME="etcd03" ETCD_DATA_DIR="/var/lib/etcd/default.etcd" ETCD_LISTEN_PEER_URLS="https://192.168.2.82:2380" ETCD_LISTEN_CLIENT_URLS="https://192.168.2.82:2379" #[Clustering] ETCD_INITIAL_ADVERTISE_PEER_URLS="https://192.168.2.82:2380" ETCD_ADVERTISE_CLIENT_URLS="https://192.168.2.82:2379" ETCD_INITIAL_CLUSTER="etcd01=https://192.168.2.88:2380,etcd02=https://192.168.2.81:2380,etcd03=https://192.168.2.82:2380" ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
./etcdctl --cacert=/k8s/etcd/ssl/ca.pem --cert=/k8s/etcd/ssl/server.pem --key=/k8s/etcd/ssl/server-key.pem --endpoints="https://192.168.2.88:2379,https://192.168.2.81:2379,https://192.168.2.82:2379" endpoint health
注意: 启动ETCD集群同时启动二个节点,启动一个节点集群是无法正常启动的; 返回以下表示ok
https://192.168.2.82:2379 is healthy: successfully committed proposal: took = 15.675731ms https://192.168.2.88:2379 is healthy: successfully committed proposal: took = 15.764248ms https://192.168.2.81:2379 is healthy: successfully committed proposal: took = 14.121678ms
感谢各位的阅读,以上就是“centos7.6下部署ETCD3.4.7 集群的详细步骤”的内容了,经过本文的学习后,相信大家对centos7.6下部署ETCD3.4.7 集群的详细步骤这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。