Wondering how Couchbase works in this situation
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!
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.
Here is how vbuckets works: http://dustin.github.com/2010/06/29/memcached-vbuckets.html
I have also answered this question here:
http://stackoverflow.com/questions/9526607/membase-how-does-this-work/
Sorry for typo in the Topic... was meant to be Membase