Client connection impossible

Hello guys, i have build a java application to manage 3 databases (MySQL, mongoDb and ElasticSearch).
evything was designed with databases in a local network and it worked very well.

Now we want to put the app on work on real servers and since then, i have problems with ElasticSearch connection.

I was first using TransportClient but when i want to use the servers databases it stopped working, telling me "No node of the configured nodes available"
i have try so many things but nothing worked.

So i decide to try to use REST Client and modify everything to make it work (client, request, etc...) but it's the same.

i'm getting very despered ... if someone can help me i would really appreciate.

This is my code :

// Set Credz
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("login", "pwd"));

// Builder
			RestClientBuilder builder = RestClient.builder(new HttpHost("ip address", 9200, "http")).setHttpClientConfigCallback(new HttpClientConfigCallback() 
			{
				@Override
				public HttpAsyncClientBuilder customizeHttpClient(HttpAsyncClientBuilder httpClientBuilder) 
				{	
					System.out.println("Setting taken !");
					return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
				}
			});					

			// Create client
			client = new RestHighLevelClient (builder);

I really don't understand why a simple application of the user guide is not working !?
i have a Java.net.ConnectException
(the exception is happening in the method where i create the client (singleton))

thanks

exception details :

java.net.ConnectException
at org.elasticsearch.client.RestClient$SyncResponseListener.get(RestClient.java:943)
at org.elasticsearch.client.RestClient.performRequest(RestClient.java:227)
at org.elasticsearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1256)
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1231)
at org.elasticsearch.client.ClusterClient.health(ClusterClient.java:146)
at utils.ElasticSearchMng.getConnection(ElasticSearchMng.java:85)
at utils.ElasticSearchMng.getLoopiesFromES(ElasticSearchMng.java:130)
at program.Program$1.run(Program.java:96)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.net.ConnectException
at org.apache.http.nio.pool.RouteSpecificPool.timeout(RouteSpecificPool.java:168)
at org.apache.http.nio.pool.AbstractNIOConnPool.requestTimeout(AbstractNIOConnPool.java:561)
at org.apache.http.nio.pool.AbstractNIOConnPool$InternalSessionRequestCallback.timeout(AbstractNIOConnPool.java:822)
at org.apache.http.impl.nio.reactor.SessionRequestImpl.timeout(SessionRequestImpl.java:183)
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processTimeouts(DefaultConnectingIOReactor.java:210)
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(DefaultConnectingIOReactor.java:155)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:348)
at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:192)
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:64)
at java.lang.Thread.run(Unknown Source)

  • look at your elasticsearch logs. Paste them here (formatted please)
  • check that you defined network.host

Hello David, i really want to thank you a lot for your very quick help. i really appreciate !
i'm sure if i had follow your ideas it would be good.
Finally the problem is resolved. Another developper of the team (who knows very well ElasticSearch because he installed it and use it everyday since 2 years), have come to see me a few minutes after my post, he have directly change the port to 8080 and he make it works in 10 minutes ... and i was struggeling for 24 hours ! Wow

Thanks a lot David

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.