Home > Database > Redis > body text

Error when connecting to redis cluster: (error) Solution to MOVED

Release: 2020-05-29 09:02:33
forward
9391 people have browsed it

Error when connecting to redis cluster: (error) Solution to MOVED

When using redis-cli to connect to the redis cluster and perform data operations, an error is reported

./redis-cli -h 192.24.54.1 -p 6379 -a '123456'
192.24.54.1:6379> get name
(error) MOVED 5798 192.24.54.2:6379
Copy after login

Solution:

This situation is generally due to Caused by not setting the cluster mode when starting redis-cli.

Use the -c parameter to start the cluster mode when starting. The command is as follows:

./redis-cli -h 192.24.54.1 -p 6379 -a '123456' -c
192.24.54.1:6379> get name
-> Redirected to slot [5798] located at 192.24.54.2:6379
"yayun"
Copy after login

For more redis knowledge, please pay attention to the redis introductory tutorial column.

The above is the detailed content of Error when connecting to redis cluster: (error) Solution to MOVED. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jianshu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template