我想使用xpack,但是使用后会出现NoNodeAvailableException。在添加xpack之前,它可以使用。
下面是我的代码:
Settings settings = Settings.builder()
.put("cluster.name",clusterName)
.put("xpack.security.user", "user:123456")
.put("client.transport.sniff",true).build();
PreBuiltXPackTransportClient preBuiltXPackTransportClient = new PreBuiltXPackTransportClient(settings);
preBuiltXPackTransportClient.addTransportAddress(new
TransportAddress(InetAddress.getByName("localhost"),9300 ));
我该怎么办?