ES客户端停写,关闭和开启集群shard allocation

编程入门 行业动态 更新时间:2024-10-25 14:28:43

ES客户端停写,关闭和开启<a href=https://www.elefans.com/category/jswz/34/1771240.html style=集群shard allocation"/>

ES客户端停写,关闭和开启集群shard allocation

客户端停写
1、关闭集群shard allocation
# curl -H "Content-Type: application/json" -XPUT http://`hostname -i`:9100/_cluster/settings -d '{"persistent": {"cluster.routing.allocation.enable": "none"}}'
{"acknowledged":true,"persistent":{"cluster":{"routing":{"allocation":{"enable":"none"}}}},"transient":{}}2、执行同步刷新
# curl -H "Content-Type: application/json" -XPOST http://`hostname -i`:9100/_flush/synced 
{"_shards":{"total":0,"successful":0,"failed":0}}3、停es集群进程4、重新开启集群shard allocation
# curl -H "Content-Type: application/json" -XPUT http://`hostname -i`:9100/_cluster/settings -d '{"persistent": {"cluster.routing.allocation.enable": "all"}}'
{"acknowledged":true,"persistent":{"cluster":{"routing":{"allocation":{"enable":"all"}}}},"transient":{}}
如果有kibana客户端,可以用一下方法:
1 客户端停写
1.1 关闭集群shard allocation
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.enable": "none"
}
}
1.2 执行同步刷新
POST _flush/synced
1.3 停es服务
2 启es集群操作
2.1 启动es服务
2.2 重新开启集群shard allocation
PUT _cluster/settings
{
"persistent": {
"cluster.routing.allocation.enable": "all"
}
} 

更多推荐

ES客户端停写,关闭和开启集群shard allocation

本文发布于:2023-07-28 21:52:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1329647.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:集群   客户端   ES   shard   allocation

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!