Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Kubernetes add and delete master node and etcd node

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Business scenario:

In the test environment, due to the limited resources at the beginning, the deployment nodes of virtual machines are all single nodes. With the increase of frequent usage, new servers are purchased and the previous master and etcd single nodes are migrated to new procurement servers. At the same time, nodes are added to 3 nodes to provide high availability environment.

Environment: etcd old node IP: 192.168.30.31etcd new node IP:192.168.30.17192.168.30.18192.168.30.19kube-apiserver old node IP:192.168.30.32kube-apiserver new node IP:192.168.30.17192.168.30.18 192.168.30.19kube-apiserver vipIP: 192.168.30.254kube-apiserver launch Application kube-apiserver kube-controller-manager kube-scheduler Node hostname node03 node4 node5etcd Node add # Operation Node: 192.168.30.3 configure etcd operating Environment API V3 version Operation Modification / etc/profile add export ETCDCTL_API=3export ENDPOINTS= https://192.168.30.31:2379source / etc/profile Modification ~ / .bashrc add alias etcdctl='/apps/etcd / bin/etcdctl-- endpoints=$ {ENDPOINTS}-- cacert=/apps/etcd/ssl/etcd-ca.pem-- cert=/apps/etcd/ssl/etcd_client.pem-- key=/apps/etcd/ssl/etcd_client-key.pem'source ~ / .bashrc Test whether the configuration is correct etcdctl endpoint health [root@etcd ~] # etcdctl endpoint health https://192.168.30.31:2379 is healthy: successfully committed proposal: took = 20.258113ms output proves that the configuration is correct # backup etcd data must be backed up. If there is no backup error, you can only redeploy the etcdctl snapshot save snapshot.db# and restore the data etcdctl snapshot restore. / snapshot.db-- name=etcd\-- initial-advertise-peer-urls= https://192.168.30.31:2380\-- initial-cluster-token=etcd-cluster-0\-- initial-cluster=etcd= https://192.168.30.31:2380\-- data-dir=/apps/ Etcd/data/default.etcd# generates a new array certificate # # create ETCD Server profile export ETCD_SERVER_IPS= "\" 192.168.30.31\ " \ "192.168.30.17\",\ "192.168.30.18\",\ "192.168.30.19\"\ "& &\ export ETCD_SERVER_HOSTNAMES="\\ "etcd\",\\ "etcd03\",\\ "etcd4\",\\ "etcd5\" & &\ cat

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report