Java program failing with None of the configured nodes are available


(Rajesh G) #1

Hi,

I'm new to Elastic search. I have 2 servers one server where Elasticsearch is configured and while other server is having java client installed. When trying to access Elasticsearch from Java program it is erroring out saying

None of the configured nodes are available: [{#transport#-1}{...}{...:9200}

Initially we thought firewalls but we have opened ports 9200, 9300 but still facing same issue. The same java program works if we have Elasticsearch installed locally.

Do you think it is still a firewall issue? If So please let me know what all ports need to be opened for Java program to work.

Thanks


(David Pilato) #2

Share your code and settings. Hard to tell here.

That said make sure you are using port 9300 from the client.


(Rajesh G) #3

Thanks David for your response.

Do you need entire code or just part of it?


(David Pilato) #4

The code which creates the transport client.


(Rajesh G) #5

Settings settings =
Settings.settingsBuilder().put("cluster.name", clusterName).build();
Client client =
TransportClient
.builder()
.settings(settings)
.build()
.addTransportAddress(
new InetSocketTransportAddress(InetAddress.getByName(host), port)
);


(David Pilato) #6

What do you have in port?

Also did you define network.host on the server?


#7

I have a similar problem. However, my Elasticsearch is on 2.4 while I am using the API v2.3.3. Can this be the cause?


(David Pilato) #8

I believe it should be compatible but the best practice for the transport client is to use same version as the server.


(system) #9