Problem Description:
Redis set, get and other operations have the following errors
(error) MOVED 8352 192.168.145.128:6380
Cause analysis:
This is generally caused by the fact that the cluster mode is not set when redis cli is started; After starting the cluster, redis cli logs in as an ordinary user and cannot operate the data in the cluster. You need to add – C to log in as a cluster mode before you can operate.
Solution:
Add – C at startup to start cluster mode
redis-cli -c -p 6379
As shown in the figure below, the operation can be successfully performed
Summary
Login in normal mode: you may directly enter the read host and move redirection will occur when storing data. Therefore, you should log in as a cluster. Add the – C parameter to connect with the cluster policy, and the setting data will be automatically switched to the corresponding write host