设为首页 加入收藏

TOP

redis配置文件redis.conf详细说明(一)
2015-11-21 01:44:59 来源: 作者: 【 】 浏览:4
Tags:redis 配置 文件 redis.conf 详细 说明

redis配置文件redis.conf详细说明

1、daemonize

# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
# Redis默认不是以守护进程的方式运行,可以通过该配置项修改,使用yes启用守护进程(守护进程
# daemon)是指在UNIX或其他多任务操作系统中在后台执行的电脑程序,并不会接受电脑用户的直接操
# 控。)
daemonize no

2、pidfile

# When running daemonized, Redis writes a pid file in /var/run/redis.pid by # default. You can specify a custom pid file location here. # 当 Redis 以守护进程的方式运行的时候,Redis 默认会把 pid 文件放在/var/run/redis.pid, # 你可以配置到其他地址。当运行多个 redis 服务时,需要指定不同的 pid 文件和端口 # pidfile /var/run/redis.pid

3、port

# Accept connections on the specified port, default is 6379. # If port 0 is specified Redis will not listen on a TCP socket. # 端口没什么好说的 port 6379

4、bind

# If you want you can bind a single interface, if the bind option is not # specified all the interfaces will listen for incoming connections. # 指定Redis可接收请求的IP地址,不设置将处理所有请求,建议生产环境中设置 # bind 127.0.0.1

5、timeout

# Close the connection after a client is idle for N seconds (0 to disable) # 客户端连接的超时时间,单位为秒,超时后会关闭连接 timeout 0

6、logfile

# Specify the log file name. Also 'stdout' can be used to force # Redis to log on the standard output. Note that if you use standard # output for logging but daemonize, logs will be sent to /dev/null # 配置 log 文件地址,默认打印在命令行终端的窗口上 logfile stdout

7、databases

# Set the number of databases. The default database is DB 0, you can select # a different one on a per-connection basis using SELECT 
         
           where # dbid is a number between 0 and 'databases'-1 # 设置
          数据库的个数,可以使用 SELECT 
          
           命令来切换数据库。默认使用的数据库是 0 databases 16
          
         

8、save

# # Save the DB on disk: # # save 
           
           
             # # Will save the DB if both the given number of seconds and the given # number of write operations against the DB occurred. # # In the example below the behaviour will be to save: # after 900 sec (15 min) if at least 1 key changed # after 300 sec (5 min) if at least 10 keys changed # after 60 sec if at least 10000 keys changed # # Note: you can disable saving at all commenting all the "save" lines. # 设置 Redis 进行数据库镜像的频率。 # 900秒之内有1个keys发生变化时 # 30秒之内有10个keys发生变化时 # 60秒之内有10000个keys发生变化时 save 900 1 save 300 10 save 60 10000
           
          

9、rdbcompression

# Compress string objects using LZF when dump .rdb databases? # For default that's set to 'yes' as it's almost always a win. # If you want to save some CPU in the saving child set it to 'no' but # the dataset will likely be bigger if you have compressible values or keys. # 在进行镜像备份时,是否进行压缩 rdbcompression yes

10、dbfinename

# The filename where to dump the DB #镜像备份文件的文件名 dbfilename dump.rdb

11、dir

# The working directory. # # The DB will be written inside this directory, with the filename specified # above using the 'dbfilename' configuration directive. # # Also the Append Only File will be created inside this directory. # # Note that you must specify a directory here, not a file name. # 数据库镜像备份的文件放置的路径。这里的路径跟文件名要分开配置是因为 Redis 在进行备份时, # 先会将当前数据库的状态写入到一个临时文件中,等备份完成时,再把该该临时文件替换为上面所指 # 定的文件,而这里的临时文件和上面所配置的备份文件都会放在这个指定的路径当中 dir ./

12、slaveof

# Master-Slave replication. Use slaveof to make a Redis instance a copy of # another Redis server. Note that the configuration is local to the slave # so for example it is possible to configure the slave to save the DB with a # different interval, or to listen to another port, and so on. # 设置该数据库为其他数据库的从数据库 # slaveof 
               
               
              

13、masterauth

# If the master is password protected (using the "requirepass" configuration # directive below) it is possible to tell the slave to authenticate before # st
首页 上一页 1 2 3 4 下一页 尾页 1/4/4
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇机房重构――存储过程 下一篇错误代码:1327Undeclaredvariabl..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: