TransportClient - Sniffing Issue


(Savva) #1

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/aec61522-40ff-4a80-acb2-1c88435998f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Savva) #2

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Jörg Prante) #3

Which is the hostName/hostPort you connect to?

Jörg

On Sun, Apr 20, 2014 at 12:08 PM, Savva 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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.comhttps://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.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAKdsXoHaceQ3a_%2BQVKu4Uc3mBtRvzVneCoJd1428hSL4S6mtPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(Savva) #4

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<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 <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/911e4e2a-404d-4835-9426-96df65bf7756%40googlegroups.comhttps://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.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/7640d6f3-5675-41cd-b6d3-5d96be2e4076%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #5