微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Redis数据被清除

如何解决Redis数据被清除

我的服务器上的docker容器中运行着一个Redis服务器。

我对所有内容都使用认值。

我用一些键值填充它并调用保存。

但是,每天都会被清除掉。日志看起来像这样

 Before turning into a replica,using my own master parameters to synthesize a cached master: I may be able to synchronize with the new master with just a partial transfer.
 REPLICAOF 46.12.32.122:8886 enabled (user request from 'id=66 addr=82.112.107.100:34932 fd=14 name= age=0 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=46 qbuf-free=32722 obl=0 oll=0 omem=0 events=r cmd=slaveof user=default')
 Connecting to MASTER 46.12.32.122:8886
 MASTER <-> REPLICA sync started
 Non blocking connect for SYNC fired the event.
 Master replied to PING,replication can continue...
 Trying a partial resynchronization (request 05e89fe9fc1391690bdeed6ce650cfd4eb511553:1).
 Full resync from master: ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ:1
 discarding prevIoUsly cached master state.
 MASTER <-> REPLICA sync: receiving 55664 bytes from master to disk
 MASTER <-> REPLICA sync: Flushing old data
 MASTER <-> REPLICA sync: Loading DB in memory
 Wrong signature trying to load DB from file
 Failed trying to load the MASTER synchronization DB from disk
 Connecting to MASTER 46.12.32.122:8886
 MASTER <-> REPLICA sync started
 Non blocking connect for SYNC fired the event.
 Error reply to PING from master: '-Reading from master: Operation Now in progress'
 Connecting to MASTER 46.12.32.122:8886
 MASTER <-> REPLICA sync started
 Non blocking connect for SYNC fired the event.
 Error reply to PING from master: '-Reading from master: Connection reset by peer'
 Connecting to MASTER 46.12.32.122:8886
 MASTER <-> REPLICA sync started
 Non blocking connect for SYNC fired the event.
 Error reply to PING from master: '-Reading from master: Connection reset by peer'
 Connecting to MASTER 46.12.32.122:8886
 MASTER <-> REPLICA sync started
 Non blocking connect for SYNC fired the event.
 Error reply to PING from master: '-Reading from master: Connection reset by peer'
 Connecting to MASTER 46.12.32.122:8886
 MASTER <-> REPLICA sync started
 Non blocking connect for SYNC fired the event.
 Error reply to PING from master: '-Reading from master: Operation Now in progress'
 Connecting to MASTER 46.12.32.122:8886
 MASTER <-> REPLICA sync started
 Non blocking connect for SYNC fired the event.
 Error reply to PING from master: '-Reading from master: Connection reset by peer'
 Module ./red2.so Failed to load: It does not have execute permissions.
 Setting secondary replication ID to 05e89fe9fc1391690bdeed6ce650cfd4eb511553,valid up to offset: 1. New replication ID is e6492767f48bc9203cda8c66520d29701364391d
 MASTER MODE enabled (user request from 'id=66 addr=82.112.107.100:34932 fd=14 name= age=7 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=34 qbuf-free=32734 obl=0 oll=0 omem=0 events=r cmd=slaveof user=default')

我想这与问题有关,但是我对为什么发生这种情况感到困惑(无论是实际复制还是失败)

解决方法

问题:redis端口已向互联网开放。

解决方案是关闭它。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。