Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Membase | Membase Server 1.7.x

Wondering how Couchbase works in this situation

4 replies [Last post]
  • Login or register to post comments
Thu, 03/01/2012 - 17:55
sjpark9
Offline
Joined: 03/01/2012
Groups: None

When I add an IP address and make connection, does the client gets All server's available IP addresses?

Or does client need to know at least 2 IP addresses for when one of them goes down?

This is the code I've been testing with (JAVA)

List addrList = new ArrayList();
addrList.add("192.168.20.105:11211");
addrList.add("192.168.20.106:11211");
addrList.add("192.168.20.101:11211");

try {

List addr = AddrUtil.getAddresses(addrList);
mbsClnt = new MemcachedClient (new BinaryConnectionFactory() , addr);

If I've added only one IP address, and while i was doing the gets and sets operation and the server goes down.
Will the client be able to connect to other available servers?
because if I add an observer and see the available servers, i dont see any (if i add only one server in the list)
Does this mean I have to add as many IP addresses as possible to avoid connection failures?

Another question is that , I can see that when i add the IP address, I have to put in PORT number which is linked to specific vBucket. Does it make any overflow from making all the clients watching a same vbucket? If so, how am I supposed to balance the Clients to watch different vBuckets?

Sorry if My English isn't really getting to you T^T.

Any kind of advices or answers will be very appreciated! Thanks!

Top
  • Login or register to post comments
Thu, 03/01/2012 - 17:56
sjpark9
Offline
Joined: 03/01/2012
Groups: None

Sorry for typo in the Topic... was meant to be Membase

Top
  • Login or register to post comments
Sat, 03/03/2012 - 10:40
creotiv
Offline
Joined: 11/14/2011
Groups: None

11211 - default port for server side moxi. So you are connecting not to the server but to moxi proxy, that rout you request to one of the servers. In most situation better to use client side moxi(on each server that connects to the membase).
Port not linked to specific vbucket. Keys are linked to vbuckets. And you don't need to balance anything, moxi making it for you.

About MemcachedClient. It doesn't know anything about Membase, they just have the same protocol. So when you add few servers on client, on each request it will be use Ketama algorithm and choose one of the servers which will get your request(if it available). So you make not needed operation, because moxi already balancing keys.

Top
  • Login or register to post comments
Sat, 03/03/2012 - 10:43
creotiv
Offline
Joined: 11/14/2011
Groups: None

Here is how vbuckets works: http://dustin.github.com/2010/06/29/memcached-vbuckets.html

Top
  • Login or register to post comments
Sun, 03/04/2012 - 14:56
mikew
Offline
Joined: 03/14/2011
Groups:

I have also answered this question here:

http://stackoverflow.com/questions/9526607/membase-how-does-this-work/

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