READONLY You can't write against a read only replica
amitnakum opened this issue · comments
I setup Redis Replication Master-Slave by loading rediSQL_0.6.0.so module on both.I have configure redis Master for Write operation and Slave for only Read.
I verify Replication Write/Read operation using SET and GET command.I can read value on slave using GET on redis-cli.But when Run Sql style query on slave, i am getting below error, Same Query is running fine on master.
[root@redis ~]# redis-cli -p 637990
127.0.0.1:637990>
127.0.0.1:637990>
127.0.0.1:637990> REDISQL.EXEC xyz "select * FROM test"
(error) READONLY You can't write against a read only replica.
I try to google this issue but there is no solution on it.
Can you Help me on this issue.
Can you try to use REDISQL.QUERY instead of REDISQL.EXEC ?
QUERY checks that the query is read-only, hence it should be allowed in the replica.
Using EXEC you could also write in the database, and you should not do so in a replica, have it is not allowed.
I believe that the QUERY command is already in the version 0.6.0 however I would suggest to upgrade if that is possible.
Please let me know how if this helps!
I replied to the same message via email, you didn't receive my email?
Cheers,
Simone