Redis Cluster: (error) MOVED

Posted felixzh

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Redis Cluster: (error) MOVED相关的知识,希望对你有一定的参考价值。

 

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的主要内容,如果未能解决你的问题,请参考以下文章

redis集群报错:(error) CLUSTERDOWN The cluster is down

Redis(1.12)Redis cluster搭建常见错误

cluster_state:fail error clusterdown hash slot not served redis集群启动失败 解决办法

Ubuntu 16.04在搭建Redis Cluster搭建时,使用gem install redis时出现:ERROR: While executing gem ... (Gem::FilePer

redis-cluster 集群搭建详细指南及常见问题集合

Redis Cluster的搭建(3.0.3)单机和双机