# TransportClient - Sniffing Issue

**URL:** <https://discuss.elastic.co/t/transportclient-sniffing-issue/17100>\
**Category:** Elasticsearch\
**Created:** [April 20, 2014, 9:56am UTC](https://discuss.elastic.co/t/transportclient-sniffing-issue/17100 "2014-04-20T09:56:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Savva](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Savva](https://discuss.elastic.co/u/Savva)\
**Post date:** [April 20, 2014, 9:56am UTC](https://discuss.elastic.co/t/transportclient-sniffing-issue/17100/1 "2014-04-20T09:56:51Z")

</div>

Hello,

I have an ES cluster that consists of two nodes. The first one is  
explicitly set to be a master and the second serves as a replica. The  
configuration of the nodes is following:

_Master Node:_  
cluster.name: "test-es-cluster"  
node.name: "primary1"  
cluster.routing.allocation.awareness.force.group.values: primary, replica  
cluster.routing.allocation.awareness.attributes: group  
node.group: primary  
node.master: true  
node.data: true  
bootstrap.mlockall: true  
discovery.zen.minimum\_master\_nodes: 1

_Replica Node:_  
cluster.name: "test-es-cluster"  
node.name: "replica1"  
cluster.routing.allocation.awareness.force.group.values: primary, replica  
cluster.routing.allocation.awareness.attributes: group  
node.group: replica  
node.master: true  
node.data: true  
bootstrap.mlockall: true  
discovery.zen.minimum\_master\_nodes: 1

Next step, I would like to explicitly connect to the replica node using a  
transport client. In order to do that, I add the client as follows:  
Settings settings = ImmutableSettings.settingsBuilder()  
.put("cluster.name", "test-es-cluster")  
.put("client.transport.ping\_timeout", "10s")  
.put("client.transport.sniff", false)  
.build();  
Client client = new TransportClient(settings)  
.addTransportAddress(new InetSocketTransportAddress(hostName, hostPort));

However, when I try to send any request to the node via the client, I catch  
the "No node available" exception:  
org.elasticsearch.client.transport.NoNodeAvailableException: No node  
available  
at  
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:196)  
at  
org.elasticsearch.client.transport.support.InternalTransportIndicesAdminClient.execute(InternalTransportIndicesAdminClient.java:73)  
at  
org.elasticsearch.client.support.AbstractIndicesAdminClient.stats(AbstractIndicesAdminClient.java:425)

Interestingly, If "client.transport.sniff" is set to be true, then  
everything works perfectly. But this way the client sends (round-robin)  
requests to the primary node too, which I try to avoid. If someone faced  
similar problem and can help to solve it, I will appreciate very much.

P.s. I run ElasticSearch 1.0.0 with AWS plugin (2.0.0.RC1) over the ec2  
instances.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/aec61522-40ff-4a80-acb2-1c88435998f4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/aec61522-40ff-4a80-acb2-1c88435998f4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Savva](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Savva](https://discuss.elastic.co/u/Savva)\
**Post date:** [April 20, 2014, 10:08am UTC](https://discuss.elastic.co/t/transportclient-sniffing-issue/17100/2 "2014-04-20T10:08:48Z")

</div>

Small typo in the configuration of the replica node.  
"node.master" is actually set to "false"

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [April 20, 2014, 11:02pm UTC](https://discuss.elastic.co/t/transportclient-sniffing-issue/17100/3 "2014-04-20T23:02:29Z")

</div>

Which is the hostName/hostPort you connect to?

Jörg

On Sun, Apr 20, 2014 at 12:08 PM, Savva [savva.khalaman@gmail.com](mailto:savva.khalaman@gmail.com) wrote:

> Small typo in the configuration of the replica node.  
> "node.master" is actually set to "false"
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHaceQ3a\_%2BQVKu4Uc3mBtRvzVneCoJd1428hSL4S6mtPQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHaceQ3a_%2BQVKu4Uc3mBtRvzVneCoJd1428hSL4S6mtPQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Savva](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@Savva](https://discuss.elastic.co/u/Savva)\
**Post date:** [April 21, 2014, 10:54am UTC](https://discuss.elastic.co/t/transportclient-sniffing-issue/17100/4 "2014-04-21T10:54:25Z")

</div>

Jörg, thank you for the reply!

hostPort is 9300.

For the hostName I have tried two options:

1. to connect to the _public IP address_ of the replica machine from my  
local PC
2. to emulate loopback architecture, e.g. the transport client is allocated  
on the same replica machine;  
hostName in this case is set to the _private IP address_ of the host.

Savva

On Monday, April 21, 2014 2:02:29 AM UTC+3, Jörg Prante wrote:

> Which is the hostName/hostPort you connect to?
> 
> Jörg
> 
> On Sun, Apr 20, 2014 at 12:08 PM, Savva \<[savva.k...@gmail.com](mailto:savva.k...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > Small typo in the configuration of the replica node.  
> > "node.master" is actually set to "false"
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/7640d6f3-5675-41cd-b6d3-5d96be2e4076%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7640d6f3-5675-41cd-b6d3-5d96be2e4076%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:34am UTC](https://discuss.elastic.co/t/transportclient-sniffing-issue/17100/5 "2017-07-06T01:34:41Z")

</div>


