Spymemcached, configure for failover

3k views Asked by At

I have a cluster of membase hosts, and I also have a set of moxi processes, running on different boxes, all configured to talk with this cluster.

My client is using spymemcached and I am trying to configure a MemcachedClient so it knows about all the available moxi processes. This way, if one of those processes dies I want spymemcached to use a different moxi and keep sending data to the cluster.

Ideally all this should be done without losing the information on the queues.

I'm playing around with two moxi processes but cannot get it to do what I want.

I've looked into http://groups.google.com/group/spymemcached/browse_thread/thread/d33ca15c0a928d37# and http://groups.google.com/group/spymemcached/browse_thread/thread/f7cc37fc509b70a6/cbb967e824a0ab04?hl=en&lnk=gst&q=redistribute#cbb967e824a0ab04 with no luck.

Can somebody tell me if this is doable in spymemcached? and if so, how should I configure it?

I'm playing with different configurations of ConnectionFactoryBuilder.

ConnectionFactoryBuilder builder = new ConnectionFactoryBuilder();
builder.setFailureMode(FailureMode.Redistribute);
builder.setProtocol(Protocol.BINARY);
builder.setLocatorType(Locator.CONSISTENT);

builder.setMaxReconnectDelay(1);
builder.setTimeoutExceptionThreshold(2);

ConnectionFactory cf = builder.build();
1

There are 1 answers

0
Rohit Karlupia On

I am not sure, but can't you specify multiple moxi servers in the spymemcached configurations? As far as I know moxi supports memcached protocol and spymemcached allows talking to multiple memcached servers. What this means is that spymemcached will choose one of the moxi servers based on consistent hashing algorithm, which doesn't really matters because finally the memcached server will be chosen by the moxi process anyway. If one of the moxi process dies, spymemcached will automatically switch to the other moxi process.