Connect to Elastic Cloud via PreBuiltXPackTransportClient

I was following the instructions from here:

and just for my initial tests I've used the following example:

import org.elasticsearch.xpack.client.PreBuiltXPackTransportClient;

TransportClient client = new PreBuiltXPackTransportClient(Settings.builder()
    .put("", "myClusterName")
    .put("", "transport_client_user:x-pack-test-password")

I'm adding the transport address like this (attention it's groovy code :wink: ):

InetAddress.getAllByName("elasticSearchAPIEndpoint_found_at_").each { address ->
    if ((address instanceof Inet6Address) || (address instanceof Inet4Address)) {
        client.addTransportAddress(new InetSocketTransportAddress(address, 9243))

Of course with the correct address to my cloud instance and my correct, also have created a new user in Kibana with role "transport_client".
ES version is 5.6.1
x-pack-transport: 5.6.1

These are the settings I can see when debugging:

My result for connectedNodes() is always empty.

My solution is the following:

It seems there is no way to get it working in the older versions...

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