Redis自动Flushhall?
我使用的是Redis 6.2.5,如果许多客户端同时访问相同的嵌套键读写操作,则所有redis db值都将丢失。其他一些客户端的数据丢失了。我尝试了 multi 和 exec 但它们不起作用,然后我尝试了 cluster 但错误并没有消失。 可以采取什么措施来解决这个问题?
I'm using Redis 6.2.5, and if many clients access the same nested key read write action at the same time, all redis db values will be lost. The data of some other clients was lost. I tried multi and exec but they didn't work, then I tried cluster but the error didn't go away.
What can be done to resolve this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Redis 是一个单线程开源应用程序。因此,数据读写操作通常在 100 毫秒内完成。
如果 Redis 崩溃,所有数据都将丢失。
所以我使用Redis云企业版。所以它工作正常。
Redis was a single-threaded opensource application. As a result, data read and write operations were typically completed in less than 100 milliseconds.
If Redis crashes, all data will be lost.
So I'm using Redis cloud enterprise. so it's working properly.
您可以重命名flushdb 和flushall 命令,以防止有人意外调用它们(如果您认为这是意外的话)。
更好的方法是设置 Redis ACL,这样应用程序用户只有必要的最低访问权限,
如果您的实例向互联网开放并且无密码,有许多恶意软件会这样做或更糟,因此安全性应该有所帮助。
另一种可能性是实例崩溃并且未启用 持久化。
You can rename the flushdb and flushall commands to stop someone from accidentally calling them if you think it is accidental.
Even better would be to setup Redis ACLs such that the application users only have the minimum access necessary
If your instance is open to the internet and passwordless there are many malwares that will do this or worse, so security should help.
The other possibility is that the instance is crashing and persistence is not enabled.