# Remove a Node from elasticsearch Transport client nodes list

**URL:** <https://discuss.elastic.co/t/remove-a-node-from-elasticsearch-transport-client-nodes-list/63349>\
**Category:** Elasticsearch\
**Created:** [October 19, 2016, 7:25am UTC](https://discuss.elastic.co/t/remove-a-node-from-elasticsearch-transport-client-nodes-list/63349 "2016-10-19T07:25:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Selvam\_ayyanar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/selvam_ayyanar/32/11101_2.png) [@Selvam\_ayyanar](https://discuss.elastic.co/u/Selvam_ayyanar)\
**Post date:** [October 19, 2016, 7:25am UTC](https://discuss.elastic.co/t/remove-a-node-from-elasticsearch-transport-client-nodes-list/63349/1 "2016-10-19T07:25:54Z")

</div>

HI All,

The Transport client comes with a cluster sniffing feature which **allows it to dynamically add new hosts and remove old ones**. When sniffing is enabled, the transport client will connect to the nodes in its internal node list, which is built via calls to addTransportAddress.

[https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/transport-client.html)

How to remove a node from elasticsearch transport client nodes list?

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [October 19, 2016, 8:13am UTC](https://discuss.elastic.co/t/remove-a-node-from-elasticsearch-transport-client-nodes-list/63349/2 "2016-10-19T08:13:36Z")

</div>

Hi @Selvam_ayyanar,

> [@Selvam\_ayyanar](#):
>
> How to remove a node from elasticsearch transport client nodes list?

You _can_ use `TransportClient#removeTransportAddress(TransportAddress)` **but** note that addresses that you provide to the transport client are only used for the initial connection. Internally, the transport client will notice when the cluster changes (due to the sniffing feature) so there should be no real need to remove a transport address even on cluster changes.

Daniel

---

<div class="post-metadata">

**Author:** ![Selvam\_ayyanar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/selvam_ayyanar/32/11101_2.png) [@Selvam\_ayyanar](https://discuss.elastic.co/u/Selvam_ayyanar)\
**Post date:** [October 19, 2016, 9:22am UTC](https://discuss.elastic.co/t/remove-a-node-from-elasticsearch-transport-client-nodes-list/63349/3 "2016-10-19T09:22:36Z")

</div>

Thanks @danielmitterdorfer

you'r right,

But i had this problem thats why im asking this question.

> [@Getting cluster blocked exception because of node started listen before join into cluster](https://discuss.elastic.co/t/getting-cluster-blocked-exception-because-of-node-started-listen-before-join-into-cluster/63345):
>
> Hi All, Today we got Below exception in webapp layer ( jboss ) [SERVICE\_UNAVAILABLE/1/state not recovered / initialized];[SERVICE\_UNAVAILABLE/2/no master]; we are using elasticsearch.jar ( transport client ) to connect es from jboss. elasticsearch version is 1.3.7 We initiated the start command at 2016-10-18 17:52:04,263 Node started to listen at [2016-10-18 17:52:06,491][INFO][transport] [node1] bound\_address {inet[/XX.XX.XX.XX:YYYY]}, publish\_address {inet[/XX.XX.X…

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [October 19, 2016, 12:19pm UTC](https://discuss.elastic.co/t/remove-a-node-from-elasticsearch-transport-client-nodes-list/63349/4 "2016-10-19T12:19:41Z")

</div>

Hi @Selvam_ayyanar,

I see but why do you want to remove a transport address then? As your original question here is answered (how to remove a transport address?), I'd say let's move the discussion to the other question.

Daniel

---

<div class="post-metadata">

**Author:** ![Selvam\_ayyanar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/selvam_ayyanar/32/11101_2.png) [@Selvam\_ayyanar](https://discuss.elastic.co/u/Selvam_ayyanar)\
**Post date:** [October 19, 2016, 1:33pm UTC](https://discuss.elastic.co/t/remove-a-node-from-elasticsearch-transport-client-nodes-list/63349/5 "2016-10-19T13:33:33Z")

</div>

Hi @danielmitterdorfer

> [@danielmitterdorfer](#):
>
> I see but why do you want to remove a transport address then?

in transport client we given 5 nodes ( es instance ) ip , the webapp ( jboss ) and es cluster running well and no problem.

we got exceptions and data loss when i restart only one the node ( try to make some changes ) from the cluster.

i.e The requests from jboss fails in a particular state

state == when the node is started to listen but not added into cluster.

so i planned to remove the node before restart it.

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [October 19, 2016, 6:07pm UTC](https://discuss.elastic.co/t/remove-a-node-from-elasticsearch-transport-client-nodes-list/63349/6 "2016-10-19T18:07:23Z")

</div>

Hi @Selvam_ayyanar,

> [@Selvam\_ayyanar](#):
>
> i planned to remove the node before restart it.

Doesn't cause this manual work? I'd rather suggest instead the solution from the [other question you've raised](https://discuss.elastic.co/t/getting-cluster-blocked-exception-because-of-node-started-listen-before-join-into-cluster/63345). As I said, the question on how to remove a transport address from the transport client is answered, so I'd say we should keep the discussion in the other thread.

Daniel

---

<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:** [July 5, 2017, 10:11pm UTC](https://discuss.elastic.co/t/remove-a-node-from-elasticsearch-transport-client-nodes-list/63349/7 "2017-07-05T22:11:09Z")

</div>


