开发者

Records inserted in REDIS are not saved

开发者 https://www.devze.com 2023-03-26 04:57 出处:网络
When we add any records(in the form of hashes or sets), do we need to COMMIT in order to save them. Is there a similar provision in REDIS?

When we add any records(in the form of hashes or sets), do we need to COMMIT in order to save them. Is there a similar provision in REDIS? I have created a virtual machine and I added records in form of 开发者_如何学Gohashes to my REDIS Cache on my m/c.

However,when I restart my Redis client and query for my records,they do not exist! Sincerely appreciate anyone's reply on an urgent basis. Thanks!


You can use AOF feature for better results


You can use SAVE as you apparently already discovered or you can use BGSAVE to run the saving task in the background and continue operating.


To see what happens "online" with your storage you can use "monitor" command. Just type it to console after redis-cli entering:

The sample:

user@user:~/Projects$ redis-cli
redis 127.0.0.1:6379> monitor
OK
1361101579.987123 "monitor"
1361102054.206754 "set" "keySample" "valSample" // in another console window I run "set keySample valSample"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号