Redis cluster error: (error) moved solution

When using redis cli to connect the redis cluster for data operation, 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

resolvent:

This situation is generally caused by not setting the cluster mode when starting redis cli .

When starting, use the - C parameter to start the cluster mode. 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"

Read More: