提问要多花一点心思哦

TransportClient怎么通过x-pack的密码认证?

Elasticsearch | 作者 菜蚜 | 发布于2018年04月16日 | 阅读数:8658

org.elasticsearch.common.settings.Settings可以传递哪些键值对?以及客户端怎么通过x-pack的密码认证才能与服务端进行通信??
已邀请:

well

赞同来自: 菜蚜

Settings settings = Settings.builder().put("xpack.security.user", xpackSecurityUser).build();
InetSocketTransportAddress[] hostArray = new InetSocketTransportAddress[hosts.length];
hostArray[i] = new InetSocketTransportAddress(ip, port);
Client client = new PreBuiltXPackTransportClient(settings).addTransportAddresses(hostArray);
 

要回复问题请先登录注册