# Transport Client issue with ES cloud

**URL:** <https://discuss.elastic.co/t/transport-client-issue-with-es-cloud/123210>\
**Category:** Elasticsearch\
**Created:** [March 9, 2018, 7:32am UTC](https://discuss.elastic.co/t/transport-client-issue-with-es-cloud/123210 "2018-03-09T07:32:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chhavi\_bahekar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chhavi_bahekar/32/82809_2.png) [@chhavi\_bahekar](https://discuss.elastic.co/u/chhavi_bahekar)\
**Post date:** [March 9, 2018, 7:32am UTC](https://discuss.elastic.co/t/transport-client-issue-with-es-cloud/123210/1 "2018-03-09T07:32:16Z")

</div>

Hi All,

I am unable to connect ES cloud with transport client version(5.6.8).Its showing error as None of the configured nodes are available.

Here is the my java Example which I have taken from github([https://github.com/elastic/found-shield-example/blob/master/src/main/java/org/elasticsearch/cloud/transport/example/TransportExample.java](https://github.com/elastic/found-shield-example/blob/master/src/main/java/org/elasticsearch/cloud/transport/example/TransportExample.java)).

Also i have tried from public network and different port combination 9243,9343.

So my Question is it possible to connect ES cloud(5.7) version with Transport Client.

Can some Please help me to resolve this issue.

Regards  
Chhavi

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 10, 2018, 6:29pm UTC](https://discuss.elastic.co/t/transport-client-issue-with-es-cloud/123210/2 "2018-03-10T18:29:15Z")

</div>

FWIW you should look at [https://github.com/elastic/found-shield-example/blob/5.1.1/src/main/java/org/elasticsearch/cloud/transport/example/TransportExample.java](https://github.com/elastic/found-shield-example/blob/5.1.1/src/main/java/org/elasticsearch/cloud/transport/example/TransportExample.java) which is probably closer to what to expect on a 5.x version.

May be share your code and the exact and full error message you are getting.

Please follow the formatting rules in this guideline: [About the Elasticsearch category](https://discuss.elastic.co/t/about-the-elasticsearch-category/21).

---

<div class="post-metadata">

**Author:** ![chhavi\_bahekar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chhavi_bahekar/32/82809_2.png) [@chhavi\_bahekar](https://discuss.elastic.co/u/chhavi_bahekar)\
**Post date:** [March 11, 2018, 3:13am UTC](https://discuss.elastic.co/t/transport-client-issue-with-es-cloud/123210/3 "2018-03-11T03:13:53Z")

</div>

Hi Dadoonet,

I am using code exactly which you share in link with 9243,9343 port.Please find code and exception below.Also tried with public network.

Code :

```
public class TransportExample {

    public Logger logger = ESLoggerFactory.getLogger(getClass().getCanonicalName());
    // Note: If enabling IPv6, then you should ensure that your host and network can route it to the Cloud endpoint.
    // (eg Docker disables IPv6 routing by default) - see also the system property parsing code below.
    private boolean ip6Enabled = true;
    private boolean ip4Enabled = true;

    public static void main(String[] args) {
        new TransportExample().run(args);
    }

    public void run(String[] args) {
         String host = "2160c0d4e57ff12912f8aaaaaaaaaaaa.us-east-1.aws.found.io";
        int port = Integer.parseInt(System.getProperty("port", "9343"));

        String hostBasedClusterName = host.split("\\.", 2)[0];
        String clusterName = System.getProperty("cluster", hostBasedClusterName);

        boolean enableSsl = Boolean.parseBoolean(System.getProperty("ssl", "true"));
        // Note: If enabling IPv6, then you should ensure that your host and network can route it to the Cloud endpoint.
        // (eg Docker disables IPv6 routing by default) - see also the initialization code at the top of this file.
        ip6Enabled = Boolean.parseBoolean(System.getProperty("ip6", "true"));
        ip4Enabled = Boolean.parseBoolean(System.getProperty("ip4", "true"));

        logger.info("Connecting to cluster: [{}] via [{}:{}] using ssl:[{}]", clusterName, host, port, enableSsl);

        // Build the settings for our client.
        Settings settings = Settings.builder()
            .put("client.transport.nodes_sampler_interval", "5s")
            .put("client.transport.sniff", false)
            .put("transport.tcp.compress", true)
            .put("cluster.name", clusterName)
            .put("xpack.security.transport.ssl.enabled", enableSsl)
            .put("request.headers.X-Found-Cluster", "${cluster.name}")
            .put("xpack.security.user", "username:password")
            .build();

        // Instantiate a TransportClient and add the cluster to the list of addresses to connect to.
        // Only port 9343 (SSL-encrypted) is currently supported. The use of X-Pack security features (formerly Shield) is required.
        TransportClient client = new PreBuiltXPackTransportClient(settings);
        try {
            for (InetAddress address : InetAddress.getAllByName(host)) {
                if ((ip6Enabled && address instanceof Inet6Address)
                        || (ip4Enabled && address instanceof Inet4Address)) {
                    client.addTransportAddress(new InetSocketTransportAddress(address, port));
                }
            }
        } catch (UnknownHostException e) {
            logger.error("Unable to get the host", e.getMessage());
        }

        while(true) {
            try {
                logger.info("Getting cluster health... ");
                ActionFuture<ClusterHealthResponse> healthFuture = client.admin().cluster().health(Requests.clusterHealthRequest());
                ClusterHealthResponse healthResponse = healthFuture.get(5, TimeUnit.SECONDS);
                logger.info("Got cluster health response: [{}]", healthResponse.getStatus());
            } catch(Throwable t) {
                logger.error("Unable to get cluster health response: [{}]", t.getMessage());
            }
            try {
                Thread.sleep(1000);
            } catch (InterruptedException ie) { ie.printStackTrace(); }
        }
    }
}

```

Exception:

```
08:25:01.339 [main] ERROR javaapplication21.TransportExample - Unable to get cluster health response: [None of the configured nodes are available: [{#transport#-1}{ZFOMH60GQgKMdxQMbzxY7Q}{2160c0d4e57ff12912f8c2798a4e7485.us-east-1.aws.found.io}{50.16.214.212:9343}, {#transport#-2}{HJi0ZrhvQuyxXbmmMS-fPg}{2160c0d4e57ff12912f8c2798a4e7485.us-east-1.aws.found.io}{54.204.11.42:9343}, {#transport#-3}{vKEGIwwJQ6uzUG55kfVvMA}{2160c0d4e57ff12912f8c2798a4e7485.us-east-1.aws.found.io}{54.197.233.100:9343}, {#transport#-4}{0qTkNoKORrW-AHcZVomvMQ}{2160c0d4e57ff12912f8c2798a4e7485.us-east-1.aws.found.io}{54.225.145.66:9343}, {#transport#-5}{NOHIVbq0Q--uPDF8jG-KYw}{2160c0d4e57ff12912f8c2798a4e7485.us-east-1.aws.found.io}{54.235.188.40:9343}, {#transport#-6}{KZ7bCyrbTh6N21z06fLPYg}{2160c0d4e57ff12912f8c2798a4e7485.us-east-1.aws.found.io}{54.243.142.98:9343}, {#transport#-7}{zSDlpeH1TDCdMmSRnIhKiA}{2160c0d4e57ff12912f8c2798a4e7485.us-east-1.aws.found.io}{50.17.198.49:9343}, {#transport#-8}{ZOY_xv1GRTua5pJRbkTpAQ}{2160c0d4e57ff12912f8c2798a4e7485.us-east-1.aws.found.io}{54.225.154.35:9343}]]

```

Regards,  
Chhavi

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 11, 2018, 7:17pm UTC](https://discuss.elastic.co/t/transport-client-issue-with-es-cloud/123210/5 "2018-03-11T19:17:33Z")

</div>

Can you try with port 9300?

Strangely the port 9200 of your instance seems to answer.

---

<div class="post-metadata">

**Author:** ![chhavi\_bahekar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chhavi_bahekar/32/82809_2.png) [@chhavi\_bahekar](https://discuss.elastic.co/u/chhavi_bahekar)\
**Post date:** [March 12, 2018, 5:14am UTC](https://discuss.elastic.co/t/transport-client-issue-with-es-cloud/123210/6 "2018-03-12T05:14:25Z")

</div>

Hi Dadoonet,

Thanks for reply,I tried for both the port but still facing same issue.

Regards,  
Chhavi

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 12, 2018, 6:22am UTC](https://discuss.elastic.co/t/transport-client-issue-with-es-cloud/123210/7 "2018-03-12T06:22:17Z")

</div>

May be contact your cloud support?  
Please see [https://www.elastic.co/cloud/as-a-service/support](https://www.elastic.co/cloud/as-a-service/support) on how to raise a support ticket for Elastic Cloud 🙂

---

<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:** [April 9, 2018, 6:22am UTC](https://discuss.elastic.co/t/transport-client-issue-with-es-cloud/123210/8 "2018-04-09T06:22:47Z")

</div>

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