4

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();
Iker Jimenez
  • 7,105
  • 9
  • 49
  • 46
  • 1
    What is it doing that you don't like? Why do you feel you need both spymemcached and moxi (the latter being a tool designed to work like the former where you don't have long-lived processes)? – Dustin Feb 10 '11 at 17:09
  • I need to use a moxi so it can distribute the keys across the membase cluster. AFAIK there is a spymemcached beta release that is adding support for this and other membase features, but we don't want to use a beta release. We have a single vbucket in membase and want to let the sharding to be done by the moxi processes. But we also want to have a failover mechanism in the client side so it can jump from one moxi to another if the in-use moxi dies without losing the data in the queue. – Iker Jimenez Feb 10 '11 at 17:27

1 Answers1

0

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.

Rohit Karlupia
  • 1,165
  • 1
  • 9
  • 5