Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | SDKs | SDKs

Does the PHP sdk know all servers?

1 reply [Last post]
  • Login or register to post comments
Sun, 06/17/2012 - 13:33
crickeys
Offline
Joined: 02/03/2012
Groups: None

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?

Top
  • Login or register to post comments
Mon, 06/18/2012 - 18:39
ingenthr
Offline
Joined: 03/16/2010
Groups:

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.

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker