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

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

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

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?

Stop the service is the only way.

Hi,

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.

is it ok in es 5.x?
thanks.
@poojagupta

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.
thanks.

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.

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