当前位置: 首页 > news >正文

ETCD 集群写满导致集群退出

[root@host-192.168.16-74 ~]# etcdctl --endpoints=http://127.0.0.1:2379 endpoint status --write-out=json | jq .[0].Status.header.revision 7407956 # 假设返回 123456,压缩到该 revision(保留最新版本) [root@host-192.168.16-74 ~]# etcdctl --endpoints=http://127.0.0.1:2379 compact 7407956 compacted revision 7407956 #整理碎片 etcdctl --endpoints=http://127.0.0.1:2379 defrag [root@host-192.168.16-74 ~]# etcdctl --endpoints=http://127.0.0.1:2379 --dial-timeout=10s endpoint status --write-out=table +-----------------------+------------------+---------+---------+-----------+-----------+------------+ | ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | RAFT TERM | RAFT INDEX | +-----------------------+------------------+---------+---------+-----------+-----------+------------+ | http://127.0.0.1:2379 | 60069b4d95cd9901 | 3.3.11 | 1.4 GB | true | 6986 | 14471872 | +-----------------------+------------------+---------+---------+-----------+-----------+------------+ #每个节点都要执行。 [root@host-192.168.16-75 ~]# ETCDCTL_API=3 etcdctl --endpoints=http://127.0.0.1:2379 --dial-timeout=10s endpoint status --write-out=table +-----------------------+------------------+---------+---------+-----------+-----------+------------+ | ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | RAFT TERM | RAFT INDEX | +-----------------------+------------------+---------+---------+-----------+-----------+------------+ | http://127.0.0.1:2379 | e9fb6ab6aa554f62 | 3.3.11 | 2.1 GB | false | 6986 | 14472089 | +-----------------------+------------------+---------+---------+-----------+-----------+------------+ [root@host-192.168.16-75 ~]# ETCDCTL_API=3 etcdctl --endpoints=http://192.168.16.74:2379,http://192.168.16.75:2379,http://192.168.16.76:2379 defrag Finished defragmenting etcd member[http://192.168.16.74:2379] Finished defragmenting etcd member[http://192.168.16.75:2379] Finished defragmenting etcd member[http://192.168.16.76:2379] ETCDCTL_API=3 etcdctl --endpoints=http://192.168.16.74:2379,http://192.168.16.75:2379,http://192.168.16.76:2379 --dial-timeout=10s endpoint status --write-out=table [root@host-192.168.16-75 ~]# ETCDCTL_API=3 etcdctl --endpoints=http://192.168.16.74:2379,http://192.168.16.75:2379,http://192.168.16.76:2379 --dial-timeout=10s endpoint status --write-out=table +--------------------------+------------------+---------+---------+-----------+-----------+------------+ | ENDPOINT | ID | VERSION | DB SIZE | IS LEADER | RAFT TERM | RAFT INDEX | +--------------------------+------------------+---------+---------+-----------+-----------+------------+ | http://192.168.16.74:2379 | 60069b4d95cd9901 | 3.3.11 | 25 kB | true | 6986 | 14472154 | | http://192.168.16.75:2379 | e9fb6ab6aa554f62 | 3.3.11 | 25 kB | false | 6986 | 14472154 | | http://192.168.16.76:2379 | e7dbae353e23179e | 3.3.11 | 25 kB | false | 6986 | 14472154 | +--------------------------+------------------+---------+---------+-----------+-----------+------------+ #--quota-backend-bytes=8589934592 #配置ETCD 的总磁盘可使用8G;默认2G; 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 WorkingDirectory=/var/lib/etcd/ EnvironmentFile=-/etc/etcd/etcd.conf User=etcd # set GOMAXPROCS to number of processors ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd --name=\"${ETCD_NAME}\" --data-dir=\"${ETCD_DATA_DIR}\" --listen-client-urls=\"${ETCD_LISTEN_CLIENT_URLS}\" --quota-backend-bytes=8589934592 " Restart=on-failure LimitNOFILE=65536 [Install] WantedBy=multi-user.target #patroni依然报错。 Jul 07 16:17:43 host-192.168.16-75 patroni[61280]: raise _raise_for_data(ret or data, response.status) Jul 07 16:17:43 host-192.168.16-75 patroni[61280]: patroni.dcs.etcd3.Unknown: <Unknown error: 'etcdserver: mvcc: database space exceeded', code: 2> Jul 07 16:17:43 host-192.168.16-75 patroni[61280]: 2026-07-07 16:17:43,356 INFO: waiting on etcd #查看警告. [root@host-192.168.16-75 ~]# ETCDCTL_API=3 etcdctl --endpoints=http://192.168.16.74:2379,http://192.168.16.75:2379,http://192.168.16.76:2379 alarm list memberID:16707138786359973790 alarm:NOSPACE #解除告警(让 etcd 允许写入) [root@host-192.168.16-75 ~]# ETCDCTL_API=3 etcdctl --endpoints=http://192.168.16.74:2379,http://192.168.16.75:2379,http://192.168.16.76:2379 alarm disarm memberID:16707138786359973790 alarm:NOSPACE #重新查看,集群已恢复正常。 [root@host-192.168.16-75 ~]# systemctl status patroni ● patroni.service - Runners to orchestrate a high-availability PostgreSQL Loaded: loaded (/etc/systemd/system/patroni.service; disabled; vendor preset: disabled) Active: active (running) since Tue 2026-07-07 16:17:42 CST; 5min ago Main PID: 61280 (patroni) CGroup: /system.slice/patroni.service ├─61280 /usr/bin/python3 /usr/local/bin/patroni /etc/patroni.yml ├─61362 /data/pgsql/13/bin/postgres -D /data/pgsql/13/data --config-file=/data/pgsql/13/data/postgresql.conf --listen_addresses=0.0.0.0 --port=5432 --cluster_name=yace_pgsql... ├─61364 postgres: yace_pgsql: logger ├─61365 postgres: yace_pgsql: startup recovering 0000000E000000110000004D ├─61372 postgres: yace_pgsql: checkpointer ├─61373 postgres: yace_pgsql: background writer ├─61374 postgres: yace_pgsql: stats collector ├─61375 postgres: yace_pgsql: walreceiver streaming 11/4D02B1F0 └─61383 postgres: yace_pgsql: postgres postgres 127.0.0.1(52950) idle Jul 07 16:21:57 host-192.168.16-75 patroni[61280]: localhost:5432 - rejecting connections Jul 07 16:21:58 host-192.168.16-75 patroni[61280]: localhost:5432 - rejecting connections Jul 07 16:21:59 host-192.168.16-75 patroni[61280]: localhost:5432 - accepting connections Jul 07 16:21:59 host-192.168.16-75 patroni[61280]: 2026-07-07 16:21:59,258 INFO: Lock owner: pg01; I am pg02 Jul 07 16:21:59 host-192.168.16-75 patroni[61280]: 2026-07-07 16:21:59,259 INFO: establishing a new patroni connection to the postgres cluster Jul 07 16:21:59 host-192.168.16-75 patroni[61280]: 2026-07-07 16:21:59,306 INFO: no action. I am (pg02), a secondary, and following a leader (pg01) Jul 07 16:22:03 host-192.168.16-75 patroni[61280]: 2026-07-07 16:22:03,527 INFO: no action. I am (pg02), a secondary, and following a leader (pg01) Jul 07 16:22:13 host-192.168.16-75 patroni[61280]: 2026-07-07 16:22:13,493 INFO: no action. I am (pg02), a secondary, and following a leader (pg01) Jul 07 16:22:23 host-192.168.16-75 patroni[61280]: 2026-07-07 16:22:23,524 INFO: no action. I am (pg02), a secondary, and following a leader (pg01) Jul 07 16:22:33 host-192.168.16-75 patroni[61280]: 2026-07-07 16:22:33,490 INFO: no action. I am (pg02), a secondary, and following a leader (pg01)
http://www.jsqmd.com/news/1145266/

相关文章:

  • 多通道数据采集仪
  • 在家也能安全连内网数据库:MariaDB监控与公网访问实战
  • AI核心组件:从感知到行动,打造超级智能体!
  • Vite原理与Webpack对比
  • 两年的AI说删就删!豆包千问集体下线智能体,大厂都在偷偷换赛道了
  • 茅台酱香酒旗舰店中的迎宾酒官方保真吗——渠道解析+鉴真指南
  • 量化派:构建物理AI通用技术底座,开启“卖能力”产业拐点
  • WebToEpub完整教程:三步将网页小说转换为电子书
  • Python正则表达式完整教程:从入门到实战,解决文本匹配所有难题
  • 看完Chronos后,这个0.3B的小模型居然超过π0.5六倍!
  • 2026最新企业低代码软件盘点:CRM、ERP、流程管理都能做
  • Vatee:把风控思路做到位——视角拆解与提示整理
  • 2026年7月中旬AI工具速报:ChatGPT推出项目模板,Claude上线批量处理,Gemini支持代码仓库分析
  • 计算机毕业设计之教材管理系统的设计与实现
  • 【2027最新】基于SpringBoot+Vue的高校实习管理系统管理系统源码+MyBatis+MySQL
  • Python正则如何处理带换行符的多行文本|解决匹配空白、提取失败问题
  • 郴州夜宵好去处实测测评|理性避坑选型指南
  • Carina:Java 写的自动化测试框架,把测试那几层全统一了
  • GHelper完整指南:用轻量级控制工具彻底解放华硕笔记本性能
  • 酒水品牌策划设计公司怎么选?从东莞视维(SIVIBRAND)的酒水案例看专业分工
  • 软考高级系统架构师之Spring AOP篇
  • Python开发中的项目结构:如何组织代码更清晰
  • 单目稠密SLAM多机协同系统:面向GPS拒止环境的鲁棒实时建图
  • 从 Spring Boot 到 NestJS:项目快速上手指南
  • 2026微信商城搭建有哪些平台
  • 计算机毕业设计之基于web的曙光社区生鲜团购平台
  • TRAE SOLO:任务原生执行器与智能工作流操作系统
  • X-Content-Type-Options 实战配置:Nginx/Apache/Express 3种服务器完整指南
  • Ubuntu service开机自启设置
  • 行业案例拆解:RFID技术在餐饮行业连锁品牌应用案例拆解!