6

I am studying redis.

I got local redis-server(localhost) and access with terminal in same device. Since I heard that redis is memory-database, I expect all data gone when I shutdown the server.

However, When I command "shudown"/"exit" in redis-cli and restart, data still alive. I think there is an option to control this, but I can not find.

Would you let me know where to find and what has to be changed?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Juneyoung Oh
  • 7,318
  • 16
  • 73
  • 121

1 Answers1

4

Look in the redis.conf file that you are using:

#   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 ""

Stop redis-server, configure it as stated above, throw away the .rdb file, and start redis-server.

From now on, on every restart, redis-server will start with no data. Plus, no automatic snapshotting will happen at all.

Note: I presume here that you have not configured AOF. If that's the case, the solution is similar to the method mentioned above.

Hope this helps, TW

Tw Bert
  • 3,659
  • 20
  • 28