Does the PHP sdk know all servers?
Sun, 06/17/2012 - 13:33
Let's say I have a 3 server cluster in couchbase 1.8. Call each server
1.1.1.1
1.1.1.2
1.1.1.3
In my php code I do this
<?php
$cb = new Couchbase("1.1.1.1:8091"); // uses the default bucket
$cb->set("a", 1);
var_dump($cb->get("a"));
?>
Now, let's say at some point 1.1.1.1 goes down. So, my PHP code is trying to reach a server that is unavailable. What happens then? Did the sdk previously store (remember), the other servers, or am I supposed to try each one in my php code?
As long as your client object is still instantiated, yes. If you have reason to re-instantiate the client, you'll want to iterate through the servers until you find one available. This is described in a bit more detail on the wiki here:
http://www.couchbase.com/wiki/display/couchbase/Couchbase+PHP+Client+Lib...
An update will add new constructor options, making this unnecessary.