Can't Connect to couchbase using DNS

I’m Using PHP SDK couchbase-php-client-2.3.1. We have docker containers setup under Openshift. I have one pod ( container with PHP website running ) another running with Couchbase server 4.x. When I try to connect the couchbase server using DNS within openshift say I have “couchbase-server-4.local” as DNS then PHP SDK doesn’t connect using DNS ie.

<?php
$cluster = new CouchbaseCluster("couchbase://couchbase-server-4.local:8091");

It doesn’t work and if I connect using local IP it works

<?php
$cluster = new CouchbaseCluster("couchbase://10.0.0.12:8091");

While PHP machine can ping and telnet the DNS successfully

Could you show the logs of the execution? The log level could be increased with INI setting couchbase.log_level:

ini_set("couchbase.log_level", "TRACE");
1 Like

If you’re using couchbase:// there shouldn’t be a port 8091. The default bootstrap port is 11210. As long as that’s open between the client and server, it should at least get that far with negotiation.

1 Like