None of the configured nodes are available - elastic 2.3.4


(Moshe Sucaz) #1

Hi, I created a new 2.3.4 elastic cluster with 3 nodes, each on different machine.
All 3 see each other when I boot the elastic. But when trying to execute actionGet (from other machine that running web application with playframework 1.4.3) , I get:

play.exceptions.JavaExecutionException: None of the configured nodes are available: [{#transport#-1}{127.0.0.11}{127.0.0.11:9300}]
at play.jobs.Job.call(Job.java:225)
at helpers.ExceptionalJob$1.call(ExceptionalJob.java:15)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

I set the client in this way:

client = TransportClient.builder().build()
.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(host), port));

my elasticsearch.yml is:

cluster.name:my_cluster
node.name: node_${HOSTNAME}
node.tag: gen1

transport.tcp.port: 9300
http.port: 9200
network.host: 0.0.0.0

http.cors.allow-origin:
bootstrap.mlockall: true

discovery.zen.ping.unicast.hosts: ["host1", "host2"]
discovery.zen.ping.multicast.enabled: false

discovery.zen.minimum_master_nodes: 2
gateway.recover_after_nodes: 1
gateway.recover_after_time: 1m
gateway.expected_nodes: 2

netstat -nltp command on all nodes machines give me:

tcp6 0 0 :::9200 :::* LISTEN 4753/java
tcp6 0 0 :::9300 :::* LISTEN 4753/java

running curl command from the playframework machine does work:

curl -XGET 127.0.0.11:9200/_count?pretty -d '{ "query": {"match": {"topic.english": "hello"}}}'
{
"count" : 94,
"_shards" : {
"total" : 107,
"successful" : 107,
"failed" : 0
}
}

I tried to replace 9300 with 9200, but it is also not working...

Any idea?


(Ada) #2

feel like it is not forming cluster. what's your cluster health status? :9200/_cluster/health is green?

Did you set the clustername when you build the client? something like this:

Settings settings = Settings.settingsBuilder().put("cluster.name", clusterName).build();
TransportClient transportClient = TransportClient.builder().settings(settings).build();
for (String server : servers) {
transportClient = transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(server), 9300));
}


(Moshe Sucaz) #3

Thanks Ada
Yes, that's exactly what I did and status is green.
Still not working...


(Moshe Sucaz) #4

Ada, when looking at it again I had a mistake where in the for loop I recreated TransportClient transportClient without the settings (which had the cluster.name in it). After copying your code problem solved! Thank you very much!!!


(system) #5