使用netstat -lntp来看看有侦听在网络某端口的进程。当然,也可以使用 lsof。
java客户端连接es5.0

java客户端连接es5.0

java客户端连接es5.0(基于xpack安全管理)

Elasticsearchnovia 发表了文章 • 19 个评论 • 15569 次浏览 • 2016-11-25 09:33 • 来自相关话题

 
Settings settings = Settings.builder().put("cluster.name", "xxx")
                    .put("xpack.security.transport.ssl.enabled", false)
                    .put("xpack.security.user", "xxx:xxx")
                    .put("client.transport.sniff", true).build();
try {
    client = new PreBuiltXPackTransportClient(settings)
            .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("xxx.xxx.xxx.xxx"), 9300))
            .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("xxx.xxx.xxx.xxx"), 9300));
} catch (UnknownHostException e) {
    e.printStackTrace();
}

java客户端连接es5.0(基于xpack安全管理)

Elasticsearchnovia 发表了文章 • 19 个评论 • 15569 次浏览 • 2016-11-25 09:33 • 来自相关话题

 
Settings settings = Settings.builder().put("cluster.name", "xxx")
                    .put("xpack.security.transport.ssl.enabled", false)
                    .put("xpack.security.user", "xxx:xxx")
                    .put("client.transport.sniff", true).build();
try {
    client = new PreBuiltXPackTransportClient(settings)
            .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("xxx.xxx.xxx.xxx"), 9300))
            .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("xxx.xxx.xxx.xxx"), 9300));
} catch (UnknownHostException e) {
    e.printStackTrace();
}