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

**URL:** <https://discuss.elastic.co/t/how-to-delete-a-node-with-api-when-the-machine-is-power-off-in-elasticsearch-5-3/97330>\
**Category:** Elasticsearch\
**Created:** [August 17, 2017, 1:14am UTC](https://discuss.elastic.co/t/how-to-delete-a-node-with-api-when-the-machine-is-power-off-in-elasticsearch-5-3/97330 "2017-08-17T01:14:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)\
**Post date:** [August 17, 2017, 1:14am UTC](https://discuss.elastic.co/t/how-to-delete-a-node-with-api-when-the-machine-is-power-off-in-elasticsearch-5-3/97330/1 "2017-08-17T01:14:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 17, 2017, 6:14am UTC](https://discuss.elastic.co/t/how-to-delete-a-node-with-api-when-the-machine-is-power-off-in-elasticsearch-5-3/97330/2 "2017-08-17T06:14:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)\
**Post date:** [August 17, 2017, 6:27am UTC](https://discuss.elastic.co/t/how-to-delete-a-node-with-api-when-the-machine-is-power-off-in-elasticsearch-5-3/97330/3 "2017-08-17T06:27:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 17, 2017, 6:38am UTC](https://discuss.elastic.co/t/how-to-delete-a-node-with-api-when-the-machine-is-power-off-in-elasticsearch-5-3/97330/4 "2017-08-17T06:38:38Z")

</div>

Stop the service is the only way.

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [August 17, 2017, 9:32am UTC](https://discuss.elastic.co/t/how-to-delete-a-node-with-api-when-the-machine-is-power-off-in-elasticsearch-5-3/97330/5 "2017-08-17T09:32:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)\
**Post date:** [August 18, 2017, 1:32am UTC](https://discuss.elastic.co/t/how-to-delete-a-node-with-api-when-the-machine-is-power-off-in-elasticsearch-5-3/97330/6 "2017-08-18T01:32:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)\
**Post date:** [August 18, 2017, 1:35am UTC](https://discuss.elastic.co/t/how-to-delete-a-node-with-api-when-the-machine-is-power-off-in-elasticsearch-5-3/97330/7 "2017-08-18T01:35:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [August 18, 2017, 3:18am UTC](https://discuss.elastic.co/t/how-to-delete-a-node-with-api-when-the-machine-is-power-off-in-elasticsearch-5-3/97330/8 "2017-08-18T03:18:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 15, 2017, 3:19am UTC](https://discuss.elastic.co/t/how-to-delete-a-node-with-api-when-the-machine-is-power-off-in-elasticsearch-5-3/97330/9 "2017-09-15T03:19:22Z")

</div>

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