es分片的命令

针对es分片的命令集合

将指定节点的es排除,不对其分片
#curl -XPUT localhost:9200/_cluster/settings -d '{
# "transient" : {
# "cluster.routing.allocation.exclude._ip" : "172.16.40.11"
# }
#}'

清除禁用状态

#curl -XPUT localhost:9200/_cluster/settings -d '{
# "transient": {
# "cluster.routing.allocation.exclude._ip": "null"
# }
#}'

开启集群自动分片
#curl -XPUT localhost:9200/_cluster/settings -d '{
# "persistent": {
# "cluster.routing.allocation.enable": "all"
# }
#}'


关闭集群自动分配片
#curl -XPUT localhost:9200/_cluster/settings -d '{
# "persistent": {
# "cluster.routing.allocation.enable": "none"
# }
#}'


重新分片
#curl -XPOST localhost:9200/_flush/synced

原文地址:https://www.cnblogs.com/llddhh/p/14452541.html