Consul 如何强制剔除无效节点,批量 force-leave 节点?
首选从 members 命令的输出中,创建一个 failed 的文件列表,文件内容为 Node 节点名称,每行一个,保存为 /tmp/failed, 然后执行这个命令就可以批量清理了, ``` for i in `cat /tmp/failed`; do echo $i ++++++++++++++; \ curl --request PUT -H 'Content-Type: application/json' 'http://127.0.0.1:8500/v1/agent/force-leave/'$i; \ done ``` /tmp/failed 文本内容,取自 `bin/consul members | awk '{print $1...阅读全文