Is Couchbase Single Point of Failure with PHP API 2.0?

This is the code to connect to a node.

$myCluster = new CouchbaseCluster('');
$myBucket = $myCluster->openBucket('default');

According to the PHP Api reference it only accepts a string, so it is not possible to insert an array of servers.

Does it mean that I’ll need to create my own functions to check if a server is up or down, and if so, try to connect to another server and so on?


Hey Valters,

You can pass a connection string to your CouchbaseCluster function. This connection string can contain multiple servers. For instance: 'couchbase://,,`.

Cheers, Brett

1 Like