关于redis:Redisconf

Redis.conf

单位
配置文件对大小写不敏感
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes

…………
蕴含
# include /path/to/local.conf
# include /path/to/other.conf


…………
bind 127.0.0.1        绑定的ip

protected-mode yes        保护模式

port 6379        端口

################################# GENERAL #####################################

daemonize yes        守护过程形式运行,默认no


pidfile /www/server/redis/redis.pid        如果当前台形式运行,要指定pid

# Specify the server verbosity level.
# This can be one of:
# debug (a lot of information, useful for development/testing)
# verbose (many rarely useful info, but not a mess like the debug level)
# notice (moderately verbose, what you want in production probably)默认,生产环境
# warning (only very important / critical messages are logged)
loglevel notice
logfile "/www/server/redis/redis.log"        地位




# dbid is a number between 0 and 'databases'-1
databases 16        默认16个数据库


长久化,redis是内存数据库,断电即失
save 900 1        如果900s内至多有一个key批改,进行长久化操作
save 300 10
save 60 10000
    
    
stop-writes-on-bgsave-error yes        长久化出错,是否持续工作
    
    
rdbcompression yes        是否压缩 rdb 文件,要耗费肯定的cpu资源
    
rdbchecksum yes        保留 rdb 文件 是否要校验
    
dbfilename dump.rdb        rdb 文件保留目录
    
    
################################# REPLICATION #################################

 
    
################################# SECURITY #################################
# requirepass foobared        设置明码
    
    
################################### CLIENTS ####################################
# maxclients 10000        最大的连接数

############################## MEMORY MANAGEMENT################################
# maxmemory <bytes>        最大的容量
    
# maxmemory-policy noeviction        内存满了怎么解决
  
    
############################## APPEND ONLY MODE ###############################
aof的配置
    
appendonly no        默认不开启,默认rdb够用了

appendfilename "appendonly.aof"            长久化的文件的名字

# appendfsync always        每次都要  sync
appendfsync everysec        每秒执行一次  sync  可能会失落一秒的数据
# appendfsync no            不执行,操作系统本人同步数据

【腾讯云】轻量 2核2G4M,首年65元

阿里云限时活动-云数据库 RDS MySQL  1核2G配置 1.88/月 速抢

本文由乐趣区整理发布,转载请注明出处,谢谢。

您可能还喜欢...

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据