# How to get Coordinating node client

**URL:** <https://discuss.elastic.co/t/how-to-get-coordinating-node-client/91400>\
**Category:** Elasticsearch\
**Created:** [June 30, 2017, 9:50am UTC](https://discuss.elastic.co/t/how-to-get-coordinating-node-client/91400 "2017-06-30T09:50:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ananth](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@ananth](https://discuss.elastic.co/u/ananth)\
**Post date:** [June 30, 2017, 9:50am UTC](https://discuss.elastic.co/t/how-to-get-coordinating-node-client/91400/1 "2017-06-30T09:50:46Z")

</div>

Hi  
Migrating to es 5.4.1 from es 2.3.2. Previously We were using nodeclient in our application. How to achieve the same in es 5.4.1 ? I have tried the coordinating node but the node not getting joined to the cluster.

es 2.3.2 snippet

> > ```
> > Settings.Builder builder = Settings.settingsBuilder();
> > builder.put("node.client", true);
> > builder.put("node.data", false);
> > builder.put("cluster.name", clusterName);
> > builder.put("discovery.zen.ping.multicast.enabled", "false");
> > builder.put("discovery.zen.ping.unicast.hosts", "ip1,ip2");
> > builder.put("http.enabled", false);
> > builder.put("path.home", "/");
> > builder.put("network.host", getHostIpAddress());
> > builder.build();
> > Node node = NodeBuilder.nodeBuilder().client(true).settings(builder).node();
> > Client nodeClient = node.client();
> > 
> > ```

> IndexRequestBuilder indexRequest = nodeClient.prepareIndex(indexName, type);

es 5.4.1 snippet

> ```
> Settings.Builder builder = Settings.builder();
> builder.put("node.data", false);
> builder.put("node.master", false);
> builder.put("node.ingest", false);
> builder.put("search.remote.connect", false);
> builder.put("cluster.name", clusterName);
> builder.put("discovery.zen.ping.unicast.hosts", "ip1,ip2");
> builder.put("http.enabled", false);
> builder.put("path.home", "../");
> builder.put("network.host", getHostIpAddress());
> builder.put("transport.type", "local");
> Settings nodeSettings = builder.build();
> Node node = new Node(nodeSettings);
> Client nodeClient = node.client();
> 
> ```

IndexRequestBuilder indexRequest = nodeClient.prepareIndex(indexName, type);

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [June 30, 2017, 12:30pm UTC](https://discuss.elastic.co/t/how-to-get-coordinating-node-client/91400/2 "2017-06-30T12:30:58Z")

</div>

Node clients are no longer supported in Elasticsearch. You should use the transport client instead, or preferrably the Java REST client if you can.

---

<div class="post-metadata">

**Author:** ![ananth](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@ananth](https://discuss.elastic.co/u/ananth)\
**Post date:** [July 3, 2017, 10:08am UTC](https://discuss.elastic.co/t/how-to-get-coordinating-node-client/91400/3 "2017-07-03T10:08:17Z")

</div>

Thanks for your reply. We are indexing nearly 20 billion messages with the size of 13TB per day. So far nodeclients are good load balancers for us which mainly avoids the transport client's two hop operation. Curious to know the reason why it is removed ?

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [July 3, 2017, 10:25am UTC](https://discuss.elastic.co/t/how-to-get-coordinating-node-client/91400/4 "2017-07-03T10:25:58Z")

</div>

This blog post details the reasons why the node/client/embedded nodes are not supported: [https://www.elastic.co/blog/elasticsearch-the-server](https://www.elastic.co/blog/elasticsearch-the-server)

---

<div class="post-metadata">

**Author:** ![ananth](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@ananth](https://discuss.elastic.co/u/ananth)\
**Post date:** [July 3, 2017, 12:30pm UTC](https://discuss.elastic.co/t/how-to-get-coordinating-node-client/91400/5 "2017-07-03T12:30:53Z")

</div>

Thanks for the info. Is it possible (or any plans to implement) to say the datanode in restclient while indexing ? So that caching the index routing table periodically in applicaiton and route to the right data node will help to reduce unnecessary the data flow over network.Or a hook to override sniffers round robin implementation ?

---

<div class="post-metadata">

**Author:** ![colings86](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/colings86/32/44960_2.png) [@colings86](https://discuss.elastic.co/u/colings86)\
**Post date:** [July 3, 2017, 1:44pm UTC](https://discuss.elastic.co/t/how-to-get-coordinating-node-client/91400/6 "2017-07-03T13:44:08Z")

</div>

There is currently no way to do this in the transport or REST clients.

---

<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 31, 2017, 1:44pm UTC](https://discuss.elastic.co/t/how-to-get-coordinating-node-client/91400/7 "2017-07-31T13:44:42Z")

</div>

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