Q:非洲食人族的酋长吃什么?

es客户端使用x-pack-transport认证连接时日志一直打印认证日志

Elasticsearch | 作者 huxz | 发布于2022年08月30日 | 阅读数:1753

es版本7.10.2
x-pack-transport版本7.10.2
客户端连接注入到spring后会一直打印认证日志

微信图片_20220830161043.jpg
        Settings settings = Settings.builder()
.put("cluster.name", "es_cluster")
.put("xpack.security.user", "elastic:123")
.put("xpack.security.transport.ssl.keystore.path", "E:\\certs\\elastic-certificates.p12")
.put("xpack.security.transport.ssl.truststore.path", "E:\\certs\\elastic-certificates.p12")
.put("xpack.security.transport.ssl.verification_mode", "certificate")
.put("xpack.security.transport.ssl.enabled", true)
.build();
TransportClient client = new PreBuiltXPackTransportClient(settings);
//TransportClient client=new PreBuiltTransportClient(settings);
String node = "192.168.1.51,192.168.1.52,192.168.1.53,";
String[] list = node.split(",");
for (String transport : list) {
String[] str = transport.split(":");
String host = "localhost";
int port = 9300;

if (str.length == 1) {
host = str[0];
}
if (str.length == 2) {
host = str[0];
port = Integer.valueOf(str[1]);
}
client.addTransportAddress(new TransportAddress(
InetAddress.getByName(host), port));
}
已邀请:

Charele - Cisco4321

赞同来自:

这debug信息啊,又不是报错。
关掉log就行了吧,

Charele - Cisco4321

赞同来自:

试下:       
Logger.getLogger("io.netty").setLevel(Level.WARN);
或者写全了Logger.getLogger("io.netty.handler.ssl.SslHandler").setLevel(Level.WARN);

Charele - Cisco4321

赞同来自:

QQ图片20220903112714.png

呵呵,它这样疯狂debug,貌似不正常。其实是有原因的。
代码里给出了解释。
不过我不懂netty,理解不了它的意思:-(

要回复问题请先登录注册