We have a Java transport client which worked fine with 6.2 jars on a 6.2 cluster but cannot connect anymore after 6.5.3 upgrade of both client and server.
We did the following
- upgrade jars to 6.5.3
- recompiled our client
- upgraded one node of our cluster in 6.5.3
- Run our 6.5.3 client against this 6.5.3 node
We get this:
2018/12/20 16:20:49 678-qes5.1.0-null-TRACE-QESHost_elastic21-sessionClient() : Nouvelle connexion ...:localhost:9300|
2018/12/20 16:20:49 678-qes5.1.0-null-DEBUG-QESHost_elastic21-connect() : cluster:elasticsearch|
2018/12/20 16:20:49 678-qes5.1.0-null-DEBUG-QESHost_elastic21-connect() : host:localhost|
2018/12/20 16:20:49 679-qes5.1.0-null-DEBUG-QESHost_elastic21-connect() : port:9300|
2018/12/20 16:20:49 679-qes5.1.0-null-DEBUG-QESHost_elastic21-connect() : Connection avec Xpack|
2018/12/20 16:20:49 679-qes5.1.0-null-DEBUG-QESHost_elastic21-connect() : Login:elastic|
2018/12/20 16:20:49 679-qes5.1.0-null-DEBUG-QESHost_elastic21-connect() : Path certificat:/usr/software/conf/elastic-certificates.p12|
2018/12/20 16:20:49 680-qes5.1.0-null-DEBUG-QESHost_elastic21-connect() : Path authorities:/usr/software/conf/elastic-certificates.p12|
2018/12/20 16:20:49 680-qes5.1.0-null-DEBUG-QESHost_elastic21-connect() : Avec certificats|
2018/12/20 16:20:50 411-qes5.1.0-null-ERROR-QESHost_elastic21-connect() : Erreur de connexion:NamedWriteable [org.elasticsearch.cluster.NamedDiff][persistent_tasks] is already registered for [org.elasticsearch.cluster.ClusterModule$$Lambda$777/506775047], cannot register [org.elasticsearch.xpack.core.XPackClientPlugin$$Lambda$784/402207819]|
java.lang.IllegalArgumentException: NamedWriteable [org.elasticsearch.cluster.NamedDiff][persistent_tasks] is already registered for [org.elasticsearch.cluster.ClusterModule$$Lambda$777/506775047], cannot register [org.elasticsearch.xpack.core.XPackClientPlugin$$Lambda$784/402207819]
at org.elasticsearch.common.io.stream.NamedWriteableRegistry.<init>(NamedWriteableRegistry.java:91)
at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:163)
at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:284)
at org.elasticsearch.transport.client.PreBuiltTransportClient.<init>(PreBuiltTransportClient.java:128)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:59)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:54)
at org.elasticsearch.xpack.client.PreBuiltXPackTransportClient.<init>(PreBuiltXPackTransportClient.java:50)
at com.qwam.qeshost.QESHost_elastic21.connect(QESHost_elastic21.java:157)
at com.qwam.qeshost.QESHost_elastic21.sessionClient(QESHost_elastic21.java:268)
at com.qwam.qeshost.QESHost_elastic21.setBase(QESHost_elastic21.java:340)
at com.qwam.qesutil.qeselasticindex.connectelastic(qeselasticindex.java:194)
at com.qwam.qesutil.qeselasticindex.main(qeselasticindex.java:1015)
2018/12/20 16:20:50 411-qes5.1.0-null-ERROR-QESHost_elastic21-sessionClient() : Connexion impossible:null|
Here is our code:
ses.log(null, "DEBUG", "QESHost_elastic21", "connect()", 3, "Login", login);
ses.log(null, "DEBUG", "QESHost_elastic21", "connect()", 3, "Path certificat", pathCertificate);
ses.log(null, "DEBUG", "QESHost_elastic21", "connect()", 3, "Path authorities", pathAuthorities);
// Connection avec Xpack installe: driver=login|password|path_certificat
Settings settings = null;
ses.log(null, "DEBUG", "QESHost_elastic21", "connect()", 3, "Avec certificats");
settings = Settings.builder()
.put("cluster.name", cluster)
.put("xpack.security.user", login + ":" + password)
.put("xpack.ssl.keystore.path", pathCertificate)
.put("xpack.ssl.truststore.path", pathAuthorities)
.put("xpack.security.transport.ssl.enabled", "true")
.put("xpack.security.transport.ssl.verification_mode", "certificate")
.build();
client = new PreBuiltXPackTransportClient(settings).addTransportAddress(new TransportAddress(InetAddress.getByName(host), port));
Our old 6.2 Java Transport client is still working on this 6.5.3 node. This looks to have something to do with the new jars and the recompilation
Tried to regenerate a new certificate with ...
/usr/software/elasticsearch/bin/elasticsearch-certutil ca
... and use it instead, without success.
I missing something there.......