码迷,mamicode.com
首页 > 其他好文 > 详细

Redis Cluster: (error) MOVED

时间:2019-07-16 15:23:36      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:container   des   err   pre   any   center   containe   read   cts   

 

I have a Redis cluster with the following nodes:

192.168.0.14:6379 master (slots from 0 to 16383)
192.168.0.15:6379 slave (slots from 0 to 16383)
192.168.0.16:6379 master (without slots)

Documentation says that any node can redirect queries to the properly node. But I can not redirect requests from 192.168.0.16:6379 master node. Here is what I tried:

192.168.0.16:6379> set myKey myValue
(error) MOVED 16281 192.168.0.14:6379
192.168.0.16:6379> get myKey
(error) MOVED 16281 192.168.0.14:6379

It neither writes nor reads. When I try to get "myKey" from 192.168.0.14:6379 it shows next:

127.0.0.1:6379> get myKey
(nil)

What is wrong with my requests? I am using redis server version 3.2.5

解决方法:

The node did redirect you.

As the documentation explains, the client is expected to connect to the specified node to retry the request. The server does not do this.

If you‘re using redis-cli, then you must use the -c option if you want it to follow these redirects.

Redis Cluster: (error) MOVED

标签:container   des   err   pre   any   center   containe   read   cts   

原文地址:https://www.cnblogs.com/felixzh/p/11195052.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!