These days customers have been to me to reflect a problem, that is, his cache server Redis will clean up the library every day, I am very puzzled, I configure the Redis generally keep the default, should not be to clean the library every day, it should be a bit of a problem with his program.
However, regardless of program problems or configuration problems, I think it is OK Clearance command, so even if his program to clean up is no way, so Baidu a bit, see all the relevant documents are written by a person, is in the redis.conf use Rename-conmand
Rename-command flushall "" Rename-command flushdb "" Rename-command KEYS "
Finished, then I went to restart Redis, thought OK, carefully read the Redis log, found that there is a problem.
Unknown command ' Flushall ' reading the Append only file
This is what the problem, direct Baidu, there is no answer to this question, look carefully append only this, feel in where seen, so to redis.conf file find, sure enough in the inside, and to the official website to see the meaning of this parameter.
############################## APPEND only mode ############################### # By default, Redis is asynchronously exporting data to disk. This mode is good enough in many applications, but the Redis process # issues or power outages can cause write loss over time (depending on the configured Save command). # # AOF is a more reliable alternative to persistence mode, such as using the default data write file policy (see following configuration) # redis# can only lose 1 seconds of write operations when encountering unexpected events such as a server power outage or a single-write process that has a problem with Redis itself, but the operating system is still functioning. # # AOF and RDB persistence can be started at the same time and there is no problem. # if AOF is turned on, Redis will load the aof file at boot time, which is more reliable for the data. # # Please see http://redis.io/topics/persistence for more information. AppendOnly No # Pure Cumulative file name (default: "Appendonly.aof") appendfilename "Appendonly.aof"
So, the idea of holding a chance, the configuration changed appendonly Yes to No, restart Redis, sure enough without any error, and that three commands are disabled.
This article is from the "Ops Space" blog, so be sure to keep this source http://drinkboy.blog.51cto.com/10606290/1757897
Configure Redis To disable several dangerous commands