[server] addr = "127.0.0.1" port = 6379 # 服务器端口 expire_check_interval_secs = 60 # 检查过期键的频率,单位为秒 log_level = "off" # 日志级别 max_connections = 256 # 最大连接数 max_batch = 1024 # 最大批量操作数 [security] # requirepass = "passwd" # 主服务器密码。当设置该值之后,客户端连接到服务器时需要发送AUTH命令进行认证 [replica] # replicaof = "127.0.0.1:6380" # 主服务器地址 max_replica = 10 # 最多允许多少个从服务器连接到当前服务器 # masterauth = "passwd" # 主服务器密码。设置该值之后,当从服务器连接到主服务器时会发送该值 # read-only = true [rdb] enable = true # 是否开启RDB持久化 file_path = "dump.rdb" # RDB文件路径 # RDB持久化间隔。seconds表示间隔时间,changes表示键的变化次数。 # 每seconds时间内有changes个键发生变化,则触发RDB快照 interval = { seconds = 1, changes = 0 } version = 6 # RDB版本 enable_checksum = true # 是否开启RDB校验和 [aof] enable = false # 是否开启AOF持久化 use_rdb_preamble = true # 是否在AOF文件开头加入RDB版本信息 file_path = "appendonly.aof" # AOF文件路径 append_fsync = "everysec" # AOF同步频率。可能为:always | everysec | no auto_aof_rewrite_min_size = 64 # 单位为mb # auto-aof-rewrite-percentage 100 # auto-aof-rewrite-min-size 64mb [memory] # maxmemory # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory # is reached. You can select one from the following behaviors: # # volatile-lru -> Evict using approximated LRU, only keys with an expire set. # allkeys-lru -> Evict any key using approximated LRU. # volatile-lfu -> Evict using approximated LFU, only keys with an expire set. # allkeys-lfu -> Evict any key using approximated LFU. # volatile-random -> Remove a random key having an expire set. # allkeys-random -> Remove a random key, any key. # volatile-ttl -> Remove the key with the nearest expire time (minor TTL) # noeviction -> Don't evict anything, just return an error on write operations. # # LRU means Least Recently Used # LFU means Least Frequently Used # # Both LRU, LFU and volatile-ttl are implemented using approximated # randomized algorithms. # # Note: with any of the above policies, when there are no suitable keys for # eviction, Redis will return an error on write operations that require # more memory. These are usually commands that create new keys, add data or # modify existing keys. A few examples are: SET, INCR, HSET, LPUSH, SUNIONSTORE, # SORT (due to the STORE argument), and EXEC (if the transaction includes any # command that requires memory). # # The default is: # # maxmemory-policy noeviction # [tls] # port = 6379 # # cert_file = "ca/rutin.crt" # key_file = "ca/rutin.key"