Redis 配置redis.conf 解读

# Redis 配置文件
#
# Redis 必须启动文件路径为第一个参数
# ./redis-server /path/to/redis.conf


# 当需要申请资源的时候,可以使用 1k 5GB 4M 或者其他格式
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
# 1gb => 1024*1024*1024 bytes
#
# units are case insensitive so 1GB 1Gb 1gB are all the same.

################################## INCLUDES  ###################################

# 将多个实例的redis 公共的配置文件抽出来 单独个别配置文件自己维护
# include /path/to/local.conf
# include /path/to/other.conf

################################ GENERAL 全局配置  #####################################

# 需要在后台守护进程 使用daemonize yes 默认为no
# 当redis 在后台运行的时候 redis 会在/var/run/redis.pid 写入pid 文件
daemonize no

pidfile /var/run/redis.pid


# redis 默认连接端口为6379
# 如设置为0 Redis 不会监听在任何TCP 连接上
port 6379


# 绑定单机唯一适配器 默认使用所有网络适配器
# bind 192.168.1.100 10.0.0.1
# bind 127.0.0.1


# 绑定单机唯一适配器 默认使用所有网络适配器
# unixsocket /tmp/redis.sock
# unixsocketperm 700

# redis 在连接n 秒之后断开连接 
# 0 表示不会主动断开连接
timeout 0

# TCP keepalive.
#在linux上,每个一段时间发送 SO_KEEPALIVE ACK的空包;推荐值为60s;  这样做的两点理由: 
# 1、阻止由于某个command执行过长达到timeout超时时间而被断开连接;  
# 2、提高连接错误的检测 
tcp-keepalive 0

# Redis 日志级别 level.
# debug (大量日志输出 主要用于测试)
# verbose (相当于debug 更多显示重要日志输出)
# notice (生成环境配置)
# warning (只有非常重要 错误日志被输出)
loglevel notice

#日志文件记录位置, 如果采用daemonize 守护进程的模式,且参数值为stdout,那
# logs 将会输出到 /dev/null
logfile ""

# 将日志输出到syslog 
# syslog-enabled no

# Specify the syslog identity.
# syslog-ident redis

# 日
  • 2
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值