arting the replication synchronization process, otherwise the master will # refuse the slave request. # 指定与主数据库连接时需要的密码验证 # masterauth
14、requirepass
# Require clients to issue AUTH
before processing any other # commands. This might be useful in environments in which you do not trust # others with access to the host running redis-server. # # This should stay commented out for backward compatibility and because most # people do not need auth (e.g. they run their own servers). # # Warning: since Redis is pretty fast an outside user can try up to # 150k passwords per second against a good box. This means that you should # use a very strong password otherwise it will be very easy to break. # 设置客户端连接后进行任何其他指定前需要使用的密码。 # 警告:redis速度相当快,一个外部的用户可以在一秒钟进行150K次的密码尝试, # 你需要指定非常非常强大的密码来防止暴力
破解。 # requirepass foobared
15、maxclient
# Set the max number of connected clients at the same time. By default there # is no limit, and it's up to the number of file descriptors the Redis process # is able to open. The special value '0' means no limits. # Once the limit is reached Redis will close all the new connections sending # an error 'max number of clients reached'. # 限制同时连接的客户数量。当连接数超过这个值时, # redis 将不再接收其他连接请求,客户端尝试连接时将收到 error 信息 # maxclients 128
16、maxmemory
# Don't use more memory than the specified amount of bytes. # When the memory limit is reached Redis will try to remove keys # accordingly to the eviction policy selected (see maxmemmory-policy). # # If Redis can't remove keys according to the policy, or if the policy is # set to 'noeviction', Redis will start to reply with errors to commands # that would use more memory, like SET, LPUSH, and so on, and will continue # to reply to read-only commands like GET. # # This option is usually useful when using Redis as an LRU cache, or to set # an hard memory limit for an instance (using the 'noeviction' policy). # # WARNING: If you have slaves attached to an instance with maxmemory on, # the size of the output buffers needed to feed the slaves are subtracted # from the used memory count, so that network problems / resyncs will # not trigger a loop where keys are evicted, and in turn the output # buffer of slaves is full with DELs of keys evicted triggering the deletion # of more keys, and so forth until the database is completely emptied. # # In short… if you have slaves attached it is suggested that you set a lower # limit for maxmemory so that there is some free RAM on the system for slave # output buffers (but this is not needed if the policy is 'noeviction'). # 设置redis能够使用的最大内存。 # 当内存满了的时候,如果还接收到set命令,redis将先尝试剔除设置过expire信息的key, # 而不管该key的过期时间还没有到达。 # 在删除时,将按照过期时间进行删除,最早将要被过期的key将最先被删除。 # 如果带有expire信息的key都删光了,那么将返回错误。 # 这样,redis将不再接收写请求,只接收get请求。 # maxmemory的设置比较适合于把redis当作于类似memcached 的缓存来使用 # maxmemory
17、appendonly
# By default Redis asynchronously dumps the dataset on disk. If you can live # with the idea that the latest records will be lost if something like a crash # happens this is the preferred way to run Redis. If instead you care a lot # about your data and don't want to that a single record can get lost you should # enable the append only mode: when this mode is enabled Redis will append # every write operation received in the file appendonly.aof. This file will # be read on startup in order to rebuild the full dataset in memory. # # Note that you can have both the async dumps and the append only file if you # like (you have to comment the "save" statements above to disable the dumps). # Still if append only mode is enabled Redis will load the data from the # log file at startup ignoring the