0
votes

I am getting started with Spring Boot and Spring Data Couchbase and I am having problems to connect to my couchbase server.

I using IntelliJ and I have used the Spring Initialzr to create my project.

Here's my configuration (I am using Kotlin):

@Configuration
class Config : AbstractCouchbaseConfiguration() {

override fun getBootstrapHosts(): List<String> = Collections.singletonList("10.0.0.10")

override fun getBucketName(): String = "cwp"

override fun getBucketPassword(): String = "password"

}

But instead of "just connecting" to the given ip there seems to be some reverse dns and so on in place which resolves wrong ips (due to routers and vpn) and so I am getting the following errors:

[CWSRV.fritz.box:8091][ConfigEndpoint]: Socket connect took longer than specified timeout: connection timed out: CWSRV.fritz.box/10.0.0.112:8091

The name of my server is CWSRV and I am using a vpn between my routers (Fritzboxes)

To omit such problems I want to use just the ip without any mishmash.

Any help would be appreciated!

1

1 Answers

1
votes

I figured it out myself:
It seems that the Java SDK does a reverse DNS lookup if it gets an IP address. Since I had not reverse zone created in my DNS server it resolved to the router on the server side which return cwsrv.fritz.box. That resolved to 10.0.0.112 (instead of 10.0.0.10 - my server could have had this ip address assigned from the router any time in the past) and there no Couchbase server responded). I created an entry of the server in my DNS and it works.

Resolution: Since the Couchbase (Java) SDK seems to rely on properly configured DNS make sure that Forward and Reverse lookups work as expected! :)