# Transport client 5.5.2 not working from Tomcat for me in EC2

**URL:** <https://discuss.elastic.co/t/transport-client-5-5-2-not-working-from-tomcat-for-me-in-ec2/113819>\
**Category:** Elasticsearch\
**Created:** [January 2, 2018, 5:58pm UTC](https://discuss.elastic.co/t/transport-client-5-5-2-not-working-from-tomcat-for-me-in-ec2/113819 "2018-01-02T17:58:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shanroam](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@shanroam](https://discuss.elastic.co/u/shanroam)\
**Post date:** [January 2, 2018, 5:58pm UTC](https://discuss.elastic.co/t/transport-client-5-5-2-not-working-from-tomcat-for-me-in-ec2/113819/1 "2018-01-02T17:58:24Z")

</div>

I have used the following configuration in a single node cluster in Ec2.  
Version 5.5.2  
elasticsearch.yml...  
(important settings)  
[cluster.name](http://cluster.name): blashblah  
[node.name](http://node.name): node1  
network.host: 172.31.18.254 #private IP  
network.publish\_host: 13.250.10.159 #public IP

TransportClient snippet:  
........  
Builder settingsBuilder = Settings.builder();  
settingsBuilder.put("[cluster.name](http://cluster.name)", clusterName);  
[//settingsBuilder.put](https://settingsBuilder.put)("client.transport.sniff","false");  
Settings settings = settingsBuilder.build();

```
		TransportClient transportClient = new PreBuiltTransportClient(settings);
		String[] nodes = nodeDetails.split(",");
		String[] nodeIpPort;
		for (String node : nodes) {
			nodeIpPort = node.split(":");
			try {
				transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(nodeIpPort[0]),
						Integer.parseInt(nodeIpPort[1])));
				client = transportClient;

```

.......................

I could connect from my localhost using transport client.

But from Ec2, I am getting issues. Though initially it says that it has connect, shortly thereafter  
it says that it could not.

[DEBUG] 2018-01-02 17:12:07.735 [localhost-startStop-1] Recycler - -Dio.netty.recycler.maxSharedCapacityFactor: disabled  
[DEBUG] 2018-01-02 17:12:07.735 [localhost-startStop-1] Recycler - -Dio.netty.recycler.linkCapacity: disabled  
[DEBUG] 2018-01-02 17:12:07.735 [localhost-startStop-1] Recycler - -Dio.netty.recycler.ratio: disabled  
**[DEBUG] 2018-01-02 17:12:07.815 [localhost-startStop-1] Netty4Transport - connected to node [{node1}{\_ENXVRE5QwOLVCbWqYddIQ}{Bu7cVvi-RDWrgqhRGj7qTA}{13.250.10.159}{13.250.10.159:9300}]**  
[DEBUG] 2018-01-02 17:12:07.816 [localhost-startStop-1] JndiTemplate - Looking up JNDI object with name [java:comp/env/spring.liveBeansView.mbeanDomain]  
[DEBUG] 2018-01-02 17:12:07.816 [localhost-startStop-1] JndiLocatorDelegate - Converted JNDI name [java:comp/env/spring.liveBeansView.mbeanDomain] not found - trying original name [spring.liveBeansView.mbeanDomain]. javax.naming.NameNotFoundException: Name [spring.liveBeansView.mbeanDomain] is not bound in this Context. Unable to find [spring.liveBeansView.mbeanDomain].  
[DEBUG] 2018-01-02 17:12:07.816 [localhost-startStop-1] JndiTemplate - Looking up JNDI object with name [spring.liveBeansView.mbeanDomain]  
[DEBUG] 2018-01-02 17:12:07.816 [localhost-startStop-1] JndiPropertySource - JNDI lookup for name [spring.liveBeansView.mbeanDomain] threw NamingException with message: Name [spring.liveBeansView.mbeanDomain] is not bound in this Context. Unable to find [spring.liveBeansView.mbeanDomain].. Returning null.  
[DEBUG] 2018-01-02 17:12:07.816 [localhost-startStop-1] PropertySourcesPropertyResolver - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source  
[DEBUG] 2018-01-02 17:12:07.816 [localhost-startStop-1] DispatcherServlet - Published WebApplicationContext of servlet 'mvc-dispatcher' as ServletContext attribute with name [org.springframework.web.servlet.FrameworkServlet.CONTEXT.mvc-dispatcher]  
[INFO] 2018-01-02 17:12:07.816 [localhost-startStop-1] DispatcherServlet - FrameworkServlet 'mvc-dispatcher': initialization completed in 2128 ms  
[DEBUG] 2018-01-02 17:12:07.816 [localhost-startStop-1] DispatcherServlet - Servlet 'mvc-dispatcher' configured successfully  
**[DEBUG] 2018-01-02 17:12:47.620 [elasticsearch[_client_][generic][T#2]] TransportClientNodesService - failed to connect to node [{#transport#-1}{yK9qHGiYR5KY5QtuuTDUoA}{13.250.10.159}{13.250.10.159:9300}], ignoring...**  
**org.elasticsearch.transport.ConnectTransportException: [][13.250.10.159:9300] handshake\_timeout[30s]**  
at org.elasticsearch.transport.TcpTransport.executeHandshake(TcpTransport.java:1614) ~[elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:555) ~[elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.transport.TcpTransport.openConnection(TcpTransport.java:116) ~[elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.transport.TransportService.openConnection(TransportService.java:351) ~[elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.client.transport.TransportClientNodesService$SimpleNodeSampler.doSample(TransportClientNodesService.java:407) [elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.client.transport.TransportClientNodesService$NodeSampler.sample(TransportClientNodesService.java:357) [elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.client.transport.TransportClientNodesService$ScheduledNodeSampler.run(TransportClientNodesService.java:390) [elasticsearch-5.5.2.jar:5.5.2]  
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:569) [elasticsearch-5.5.2.jar:5.5.2]  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0\_151]  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0\_151]  
at java.lang.Thread.run(Thread.java:748) [?:1.8.0\_151]

**I have written a small test program to do the same things that I was doing in the web application above and it succeeded from EC2.**

NOW MY QUESTION IS THAT THE FAILURE LOGS ARE INSUFFICIENT TO FIND OUT WHAT  
IS HAPPENING HERE.  
CAN SOMEONE SUGGEST SOME TOOLS OR ADDL. CODE TO PROBE FURTHER.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [January 3, 2018, 9:49am UTC](https://discuss.elastic.co/t/transport-client-5-5-2-not-working-from-tomcat-for-me-in-ec2/113819/2 "2018-01-03T09:49:32Z")

</div>

have you written a small program to check if you can connect only or also send data?

The handshake timeout seems to indicate that connecting may have worked but no data could be exchanged. Also, by configuring the publish host you should make sure, that you can connect to this one as well - and of course make sure, that one is not exposed to the internet and leaves Elasticsearch open.

---

<div class="post-metadata">

**Author:** ![shanroam](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@shanroam](https://discuss.elastic.co/u/shanroam)\
**Post date:** [January 3, 2018, 10:48am UTC](https://discuss.elastic.co/t/transport-client-5-5-2-not-working-from-tomcat-for-me-in-ec2/113819/3 "2018-01-03T10:48:12Z")

</div>

Hi spinscale,  
Thanks for taking the time to reply.

The issue just got resolved. I just increased the heap allocation  
and it started working.  
My program is running on Tomcat / Java 8, BTW.  
I may have eaten some exceptions in my code or some  
other used code may have.

If you have any better explanation please let me know.  
But for now, my issue is resolved.  
I need to close it.  
Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 31, 2018, 10:48am UTC](https://discuss.elastic.co/t/transport-client-5-5-2-not-working-from-tomcat-for-me-in-ec2/113819/4 "2018-01-31T10:48:28Z")

</div>

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