Bucket connection issues

We’re having some issues when connecting to buckets.

Our setup is a webserver (PHP) with a couchbase server. They’re running on Amazon AWS with an internal network between the two. This is working correctly, and they are communicating correctly.

For development machines, we connect to the same couchbase server, but use different buckets. We only have the external IP in our configuration, but it appears Couchbase is switching to the internal IP to communicate with the actual buckets. Obviously this doesn’t work.

We’re running Couchbase 4.5.1. The web server is running PHP 5.6 with couchbase extension version 2.2.4. The local development machine in question is running PHP 7.1 with couchbase extension version 2.4.2.

Is there any way to force the extension to actually use the IP that is supplied and used when connecting to couchbase for communication with the buckets?

I’ve attached the actual monitored network communication.

This is actually not SDK library problem, the cluster have to be configured to use external addresses, or your DNS should allow resolve the same names to different addresses depending from where you are trying to connect.

The PHP SDK just uses address from that topology configuration message you’ve shown on the screenshot, and if that message contains addresses from private network, that means the cluster configured to use them.

Ideally, you should have used FQDN names for the nodes during configuration, because in this case, all you need to do is either reconfigure DNS service or just drop the lines into your local /etc/hosts (for development environment).

More information on the topic:

Thank you for the clear answer.

I was hoping to solve the issue locally, but I will ask the system administrator to change the server configuration.