I can't get the Java API transport client to work with 5.4.1.
Below is the code snippet:
Settings settings = Settings.builder() .put("client.transport.sniff", true) .put("xpack.security.user", "transport_client_user:changeme") .build();
client = new PreBuiltXPackTransportClient(settings); client = client.addTransportAddresses(new InetSocketTransportAddress(InetAddress.getByName(host), port));
Then I get the following error:
[elasticsearch[client][transport_client_boss][T#1]] INFO org.elasticsearch.client.transport.TransportClientNodesService - failed to get local cluster state for {#transport#-1}{uJ_F0oqAT0ucSdpkfkzpCg}{localhost}{127.0.0.1:9300}, disconnecting...
[elasticsearch[client][transport_client_boss][T#2]] INFO org.elasticsearch.client.transport.TransportClientNodesService - failed to get local cluster state for {#transport#-2}{KLVUgCedQLeGMq_mNa6HpQ}{localhost}{127.0.0.1:9301}, disconnecting...
RemoteTransportException[[darkstar-1][127.0.0.1:9300][cluster:monitor/state]]; nested: ElasticsearchSecurityException[unable to authenticate user [transport_client_user] for action [cluster:monitor/state]];
Caused by: ElasticsearchSecurityException[unable to authenticate user [transport_client_user] for action [cluster:monitor/state]]
...
Reading other problems like this, it seemed this was fixed in 5.4.1. I think it isn't. Will I have to take out the X-Pack plug in?
Ed Brown