How to delete a node with api? when the machine is power off in elasticsearch 5.3

(andy_zhou) #1

how to delete a node with api? elasticsearch 5.3 ,when the matchine is offline.

(Mark Walkom) #2

You cannot do this. If the node is no longer part of the cluster then it will eventually age out of cluster state.

(andy_zhou) #3

when the machine is not ok system halted ,but the ports is can telnet and the machine can ping ,
how can remove the node as soon as i can?

(Mark Walkom) #4

Stop the service is the only way.

(poojagupta) #5


To remove a node from your elastic search cluster run the following api:
curl -XPUT localhost:9200/_cluster/settings -d '{
"transient" :{
"cluster.routing.allocation.exclude._ip" : "x.x.x.x"
Where "x.x.x.x" is the IP of node which you want to remove.
This API do reallocation of index data in the remaining nodes.

(andy_zhou) #6

is it ok in es 5.x?

(andy_zhou) #7

whe a machine have many data nodes,
how can use the settings if i only need delete one data node,
ie: data01:9200 ,data02:9201 i only delte data02.

(poojagupta) #8

Yes it is ok with elasticsearch 5.x .
and as i mentioned above, you have to mention the ip of that node which you want to delete , after execution of that API, that node will not be part of the cluster and all data allocation happened with remaining nodes only.

(system) #9

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.