# Unable to connect Node (client)

**URL:** <https://discuss.elastic.co/t/unable-to-connect-node-client/34282>\
**Category:** Elasticsearch\
**Created:** [November 10, 2015, 8:06pm UTC](https://discuss.elastic.co/t/unable-to-connect-node-client/34282 "2015-11-10T20:06:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Hudson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brian_hudson/32/1306_2.png) [@Brian\_Hudson](https://discuss.elastic.co/u/Brian_Hudson)\
**Post date:** [November 10, 2015, 8:06pm UTC](https://discuss.elastic.co/t/unable-to-connect-node-client/34282/1 "2015-11-10T20:06:51Z")

</div>

I am running ES on my local dev machine with the following elasticsearch.yml:

```
cluster.name: myCluster
path.data: /usr/local/var/elasticsearch
path.logs: /usr/local/var/log/elasticsearch/
script.inline: on

```

I am trying to connect to the cluster using a Node(Client):

```
 NodeBuilder.nodeBuilder()
            .settings(Settings.builder()
                              .put("cluster.name", "myCluster")
                              .put("node.name", "myNode")
                              .put("path.home", "some/dir")
                              .put("discovery.zen.ping.unicast.hosts", "localhost")
                              .build())
            .client(true)
            .node();

```

However this results in master not found. This worked prior to ES 2.0, for 2.0 I added the `path.home` to settings.

I've worked around the issue for now by switching to the transport client, but would prefer to connect via Node(Client).

---

<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:** [November 11, 2015, 4:58am UTC](https://discuss.elastic.co/t/unable-to-connect-node-client/34282/2 "2015-11-11T04:58:52Z")

</div>

It's not [https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking\_20\_network\_changes.html#\_bind\_to\_localhost](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_20_network_changes.html#_bind_to_localhost) is it?

---

<div class="post-metadata">

**Author:** ![Brian\_Hudson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brian_hudson/32/1306_2.png) [@Brian\_Hudson](https://discuss.elastic.co/u/Brian_Hudson)\
**Post date:** [November 12, 2015, 12:52pm UTC](https://discuss.elastic.co/t/unable-to-connect-node-client/34282/3 "2015-11-12T12:52:16Z")

</div>

I don't think so, both nodes are running on my local dev machine. I did see that though and played around with the `network.host` setting, but I was still unable to get the Node(Client) to connect.

TransportClient works with almost identical settings:

```
TransportClient client;
client = TransportClient.builder()
                         .settings(Settings.builder()
                                           .put("cluster.name", "myCluster")
                                           .build())
                         .build();
client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("localhost"), 9300));
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 12, 2015, 3:06pm UTC](https://discuss.elastic.co/t/unable-to-connect-node-client/34282/4 "2015-11-12T15:06:33Z")

</div>

`network.host: localhost` should work I think if you run on the same machine.

Did you change other settings? Such as port number for example?

---

<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, 11:38pm UTC](https://discuss.elastic.co/t/unable-to-connect-node-client/34282/5 "2017-07-05T23:38:57Z")

</div>


