If the above error occurs, it means that the current redis service is read-only and has no write permission. It is estimated that the service is used as a slave database.
solution:
- Open the configuration file corresponding to the redis service and change the value of the attribute slave-read-only to no, so that it can be written.
- Or a faster method is to
redis-cli
open the client mode through a command and enter aslaveof no one
command to stop the current redis service from receiving synchronization from other redis services and upgrade itself to the main database at the same time.