2015-09-22 55 views
0

我是Redis的新手,我试图删除Ram上的一个键,但它已经存在于磁盘上的哑文件中。重新启动服务器后,Ram上的密钥已存在。请帮帮我。如何在RAM和磁盘之间同步数据?如何删除磁盘上的Redis密钥?

+0

请帮助我,我不知道为什么它不工作。 这里是我的配置文件 - redis.windows-service.conf(http://www.mediafire.com/view/89o0ff9df8bb0bb/redis.windows-service.conf) 和redis.windows.conf(http:// www .mediafire.com/view/3rhdxkdo9i1l6l8/redis.windows%282%29.conf) – Ducthien

回答

1

取决于您的配置文件,您可以修改您redis config file,如

appendonly yes 
appendfsync always 
# appendfsync everysec 
# append 

希望帮助。

+0

我只是配置,如你建议,但它不工作。 请帮助我,下面是我的配置文件。它有什么不对吗? [链接文件配置](http://www.mediafire.com/view/k03ckybn2yvb6j2/redis.windows.conf) – Ducthien

+0

redis-server Javy

+0

我附加的文件是。你能帮我找到任何我配置错误的东西吗? – Ducthien

1
appendonly yes 
appendfsync always 
# appendfsync everysec 
# append 

做到像上面所说Javy肯定是要去帮助,这使AOF和RAM确保数据同步到磁盘上的每一秒。 另一种方法是发出一个BGSAVE命令来立即产生一个新的dump.rdb文件。我认为你应该修改自动转储执行的频率。这是在redis.conf中。查看项目保存。

想我最好的后段相对为你:

################################ SNAPSHOTTING ################################ 
# 
# Save the DB on disk: 
# 
# save <seconds> <changes> 
# 
# Will save the DB if both the given number of seconds and the given 
# number of write operations against the DB occurred. 
# 
# In the example below the behaviour will be to save: 
# after 900 sec (15 min) if at least 1 key changed 
# after 300 sec (5 min) if at least 10 keys changed 
# after 60 sec if at least 10000 keys changed 
# 
# Note: you can disable saving completely by commenting out all "save" lines. 
# 
# It is also possible to remove all the previously configured save 
# points by adding a save directive with a single empty string argument 
# like in the following example: 
# 
# save "" 

如果您DONOT知道如何更改配置文件,按照指定的顺序键入以下命令:

config set appendonly yes 
config set appendonly everysec 
config rewrite 

如果有什么不清楚的地方,请随时回复。

+0

我只是配置如你建议的,但它不工作。请帮助我,下面是我的配置文件。它有什么不对吗? [链接文件配置](http://www.mediafire.com/view/k03ckybn2yvb6j2/redis.windows.conf) – Ducthien

+0

你的conf文件是可以的,但你可能会改变“appendfsync总是 ”到“appendfsync everysec”到使您的Redis运行得更快。 –

+0

我认为问题可能在于如何重新启动您的Redis服务器。你能告诉我你用来重新启动你的redis的确切命令吗? –