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() 
				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
(the exception is happening in the method where i create the client (singleton))


exception details :
at org.elasticsearch.client.RestClient$SyncResponseListener.get(
at org.elasticsearch.client.RestClient.performRequest(
at org.elasticsearch.client.RestHighLevelClient.performRequest(
at org.elasticsearch.client.RestHighLevelClient.performRequestAndParseEntity(
at utils.ElasticSearchMng.getConnection(
at utils.ElasticSearchMng.getLoopiesFromES(
at program.Program$
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$ Source)
at java.awt.EventQueue$ Source)
at Method)
at$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 Source)
Caused by:
at org.apache.http.nio.pool.RouteSpecificPool.timeout(
at org.apache.http.nio.pool.AbstractNIOConnPool.requestTimeout(
at org.apache.http.nio.pool.AbstractNIOConnPool$InternalSessionRequestCallback.timeout(
at org.apache.http.impl.nio.reactor.SessionRequestImpl.timeout(
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processTimeouts(
at org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor.processEvents(
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(
at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(
at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$
at Source)

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

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.