READONLY: READONLY You can't write against a read only replica
Redis의미
쓰기 명령이 replica(slave) 노드로 전송되었다. replica는 기본적으로 읽기 전용이며 쓰기는 master에서만 수행할 수 있다.
원인
클라이언트가 master 대신 replica에 접속, 페일오버 후 기존 master가 replica가 됨, Sentinel/Cluster에서 잘못된 노드로 라우팅, 또는 로드 밸런서가 쓰기를 replica로 전달.
해결 방법
쓰기 요청을 master 노드로 라우팅한다. Sentinel을 사용한다면 Sentinel에서 현재 master를 조회한다(SENTINEL get-master-addr-by-name). Cluster에서는 올바른 샤드 master에 쓴다. 클라이언트 라이브러리에서 읽기/쓰기 분리를 구성한다. 페일오버 후에는 연결을 갱신해 새 master를 가리키게 한다.
같은 데이터베이스의 다른 항목
- OOMOOM command not allowed when used memory > 'maxmemory'
- NOAUTHNOAUTH Authentication required
- WRONGPASSWRONGPASS invalid username-password pair or user is disabled
- MASTERDOWNMASTERDOWN Link with MASTER is down and replica-serve-stale-data is set to 'no'
- CLUSTERDOWNCLUSTERDOWN The cluster is down / Hash slot not served
- LOADINGLOADING Redis is loading the dataset in memory
- BUSYBUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE