Consul容器无法启动
约 340 字大约 1 分钟
2025-03-11
之前部署的 Consul 容器无法启动,查看了日志,发现报错信息是:refusing to rejoin cluster because server has been offline for more than the configured server_rejoin_age_max - consider wiping your data dir。
大致意思是:因为服务器离线时间太长, 拒绝重新加入集群,考虑擦除数据目录。
解决方案
删除data(/consul/data)目录下的server_metadata.json文件后,重启容器。
完整日志
2025-03-11T15:02:52.564Z [ERROR] agent: startup error: error="refusing to rejoin cluster because server has been offline for more than the configured server_rejoin_age_max (168h0m0s) - consider wiping your data dir"
2025-03-11T15:03:02.565Z [ERROR] agent: startup error: error="refusing to rejoin cluster because server has been offline for more than the configured server_rejoin_age_max (168h0m0s) - consider wiping your data dir"
2025-03-11T15:03:12.565Z [ERROR] agent: startup error: error="refusing to rejoin cluster because server has been offline for more than the configured server_rejoin_age_max (168h0m0s) - consider wiping your data dir"
2025-03-11T15:03:22.566Z [ERROR] agent: startup error: error="refusing to rejoin cluster because server has been offline for more than the configured server_rejoin_age_max (168h0m0s) - consider wiping your data dir"
2025-03-11T15:03:32.567Z [ERROR] agent: startup error: error="refusing to rejoin cluster because server has been offline for more than the configured server_rejoin_age_max (168h0m0s) - consider wiping your data dir"
2025-03-11T15:03:42.568Z [ERROR] agent: startup error: error="refusing to rejoin cluster because server has been offline for more than the configured server_rejoin_age_max (168h0m0s) - consider wiping your data dir"
2025-03-11T15:03:52.568Z [ERROR] agent: Error starting agent: error="refusing to rejoin cluster because server has been offline for more than the configured server_rejoin_age_max (168h0m0s) - consider wiping your data dir"