Spymemcached,配置故障转移

发布于 2024-10-16 23:01:01 字数 1251 浏览 6 评论 0原文

我有一个 membase 主机集群,还有一组 moxi 进程,在不同的机器上运行,所有进程都配置为与该集群通信。

我的客户端正在使用spymemcached,我正在尝试配置MemcachedClient,以便它了解所有可用的moxi进程。这样,如果其中一个进程死亡,我希望spymemcached使用不同的moxi并继续向集群发送数据。

理想情况下,所有这些都应该在不丢失队列信息的情况下完成。

我正在玩两个 moxi 进程,但无法让它执行我想要的操作。

我研究过 http://groups.google.com/group/spymemcached /browse_thread/thread/d33ca15c0a928d37#http://groups.google.com/group/spymemcached/browse_thread/thread/f7cc37fc509b70a6/cbb967e824a0ab04?hl=en&lnk=gst&q=redistribute#cbb967e824a0ab04 没有运气。

有人可以告诉我这在spymemcached 中是否可行吗?如果是这样,我应该如何配置它?

我正在使用 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();

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();

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

归途 2024-10-23 23:01:01

我不确定,但是你不能在spymemcached配置中指定多个moxi服务器吗?
据我所知,moxi 支持 memcached 协议,spymemcached 允许与多个 memcached 服务器通信。这意味着spymemcached将根据一致性哈希算法选择其中一个moxi服务器,这并不重要,因为最终memcached服务器无论如何都会由moxi进程选择。如果其中一个 moxi 进程死亡,spymemcached 会自动切换到另一个 moxi 进程。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文