Failover using Java client API
a a
akannan13 at yahoo.com
Wed Jun 15 11:50:55 PDT 2005
I'm using the java client api (1.2.1) with 2 memcache
instances.
//set up sock io pool
SockIOPool pool = SockIOPool.getInstance();
pool.setServers(new String[]
"xx.xx.xx.xyz:123","xx.xx.xx.xyz:1234"});
pool.setFailover(true);
pool.initialize();
//connect , set & get
MemCachedClient mc = new MemCachedClient();
mc.set("key999","Sample value");
System.out.println( mc.get("key999"));
My question is, if one of the servers in my pool is
down and the hashing algorithm selects that server for
the given key it doesn't seem to be failing over to
the next server. I took a look at the code and it does
seem to try twice by rehashing but the hash yields the
same bucket.
What am I missing here? Is this expected behavior?
Thanks
Arun
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the memcached
mailing list