Hi, I'm using Redis for caching on some top pages of a website. This is to say, no critical things happening, so after a crash or new deployment it is fine to lose all Cache.
Occasionly Redis throws this error (from my client ioredis logs):
READONLY You can't write against a read only replica.
This comes with a whole app crash, I suspect my Fastify/client here and not Redis, but I will try to deal with this.
But I'm thinking of no persistence and a single Redis node from the beginning would suits my case and maybe safer. So how to achieve this ? I'm using a default Redis config file with minor modifications (network).
Thanks
Comment From: oranagra
@bacloud22 replication won't be enabled unless you enable it (set up two instances of redis and set on to replicate form the other).
persistence is enabled by default for snapshots, and it's easy to disable by setting the save config to an empty string.
I suspect that in your case you might have left your redis unprotected by password and exposed to the internet, and someone's trying to hack you. if you'll look at your log file, you'll probably discover they've set it to a replica to download an "rdb" file from a malicious source, and then attempt to load that as a module (i've seen this attack before).
Comment From: ghost
I doubt a modification of state from outside (hack). There is a firewall and a proxy and Redis port is closed.
For the solution, that was what I did save "". No more errors which is great.
But I'm setting a password to avoid any harm.
Thanks a lot 😁
Comment From: ghost
And true there are zillions of hacker (bots maybe) in the wild. I found strange logs on http server looking for /security.txt and so on .. get to be careful 🥵
Comment From: oranagra
@bacloud22 the error you quoted (READONLY You can't write against a read only replica) doesn't seem like something that'll be affected by the save config.
it indicates that the redis the client was connected to was configured as a replica, so if that's not you, someone else issued the SLAVEOF or REPLICAOF command...