I try to connect to a couchbase cluster with this way:
$cb = new Couchbase(array(“ip-20-296-110-131.ec2.internal:8091”,“ip-20-254-129-133.ec2.internal:8091”), COUCHBASE_USER, COUCHBASE_PASS, COUCHBASE_VIEWS_BUCKET);
When the first node in the array is down, there isn’t any other connection attempt to the second node in the array. This code line just returns after 3 seconds.
If I change the order of the nodes in the array, so that the good node will be the first one, then it connects immediately.
Why does the class behave like that? I thought it should connect to all of the nodes in the list.
That’s strange… My cluster is running on AmazonAmi (CentOS) and the PHP application runs on Apache 2.4 (also on Amazon AMI).
When looking at the traffic on port 8091 on the php machine, it looks like it’s trying to connect to the bad machine (lots of SYNs) and not even trying to connect to the good one (which is second on the list).
Any ideas?
Hey edibusl, what libcouchbase version do you have installed? There is a known issue with older libcouchbase versions which would cause this problem. I suggest updating your libcouchbase and php-ext-couchbase to the latest versions. Cheers, Brett