Configure Redis To disable several dangerous commands

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.