Domanda

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?

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top