Elasticsearch Connector would not reconnect to Couchbase nodes when their IP changed on Kubernetes

Errors happen from time to time in a Cloud environment, Couchbase nodes come and go. When a Couchbase Pod is restarted on Kubernetes, the Elasticsearch Connector running on Kubernetes may not be able to access the bootstrap nodes (or any for that matter) when their IP changed.

Details:
Elasticsearch Conenctor uses Kubernetes internal DNS to access Couchbase nodes, namely couchbase-0.couchbase.production.svc.omega, couchbase-1.couchbase.production.svc.omega, and so on.

[couchbase]
hosts = ['couchbase-0.couchbase-server.production.svc.omega', 'couchbase-1.couchbase-server.production.svc.omega', 'couchbase-2.couchbase-server.production.svc.omega', 'couchbase-3.couchbase-server.production.svc.omega']

When an IP of such a node changes, the Java DCP client will not attempt to resolve the IP address again. In the Couchbase Client library for Java, we force DNS resolution with the following flag: com.couchbase.forceDnsLookupOnReconnect = "true"

It is crucial to have something similar for the DCP Java Client. If there is, we could not find it so far.

Thanks for the help!

Hi Zoltan,

Thanks for the detailed issue report. It’s filed as JDCP-163. This definitely sounds like something we want to fix in the next release.

Thanks,
David

1 Like

Hi Zoltan, this is fixed in version 4.2.2 of the connector which was recently released.
Thanks,
David

1 Like