前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >etcd 集群7

etcd 集群7

作者头像
franket
发布2022-01-19 11:17:43
1280
发布2022-01-19 11:17:43
举报
文章被收录于专栏:技术杂记

删除一个节点

删除节点相对简单

代码语言:javascript
复制
[root@h104 etcd-v2.2.4-linux-amd64]# ./etcdctl  member  list
1b80a88a471eb4b8: name=h104 peerURLs=http://192.168.100.104:2380 clientURLs=http://192.168.100.104:2379
84099faad6d56427: name=h102 peerURLs=http://192.168.100.102:2380 clientURLs=http://192.168.100.102:2379
940f6e83e019a03f: name=docker peerURLs=http://192.168.100.103:2380 clientURLs=http://192.168.100.103:2379
[root@h104 etcd-v2.2.4-linux-amd64]# ./etcdctl  member  remove 84099faad6d56427
Removed member 84099faad6d56427 from cluster
[root@h104 etcd-v2.2.4-linux-amd64]# ./etcdctl  member  list
1b80a88a471eb4b8: name=h104 peerURLs=http://192.168.100.104:2380 clientURLs=http://192.168.100.104:2379
940f6e83e019a03f: name=docker peerURLs=http://192.168.100.103:2380 clientURLs=http://192.168.100.103:2379
[root@h104 etcd-v2.2.4-linux-amd64]# curl http://localhost:2379/v2/members
{"members":[{"id":"1b80a88a471eb4b8","name":"h104","peerURLs":["http://192.168.100.104:2380"],"clientURLs":["http://192.168.100.104:2379"]},{"id":"940f6e83e019a03f","name":"docker","peerURLs":["http://192.168.100.103:2380"],"clientURLs":["http://192.168.100.103:2379"]}]}
[root@h104 etcd-v2.2.4-linux-amd64]# 

同时 h102 的日志中出现如下信息,最后退出

代码语言:javascript
复制
...
...
...
2016-02-16 17:42:21.320955 I | rafthttp: the connection with 1b80a88a471eb4b8 became inactive
2016-02-16 17:42:21.321053 E | rafthttp: failed to dial 1b80a88a471eb4b8 on stream MsgApp v2 (the member has been permanently removed from the cluster)
2016-02-16 17:42:21.321402 E | etcdserver: the member has been permanently removed from the cluster
2016-02-16 17:42:21.321452 I | etcdserver: the data-dir used by this member must be removed.
2016-02-16 17:42:21.341262 I | rafthttp: the connection with 940f6e83e019a03f became inactive
2016-02-16 17:42:21.341313 E | rafthttp: failed to dial 940f6e83e019a03f on stream MsgApp v2 (the member has been permanently removed from the cluster)
2016-02-16 17:42:21.342089 E | rafthttp: failed to dial 940f6e83e019a03f on stream Message (net/http: request canceled)
2016-02-16 17:42:21.342314 E | etcdhttp: error removing member 84099faad6d56427 (etcdserver: server stopped)
2016-02-16 17:42:21.342338 E | etcdhttp: got unexpected response error (etcdserver: server stopped)
[root@h102 etcd-v2.2.4-linux-amd64]#

Tip: 直接删除leader也是安全的,只是在选举出新的leader前集群是不可用状态,时长相当于一个选举timeout周期加上投票过程耗费的总时间

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 删除一个节点
相关产品与服务
容器服务
腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档