• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
导航菜单
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx
您的位置:首页 > 服务器 >windows > Redis 默认配置精简及注释说明

Redis 默认配置精简及注释说明

作者:网友 字体:[增加 减小] 来源:互联网

本文主要包含redis默认端口,redis默认过期时间,redis默认端口号,redis默认安装路径,redis默认配置文件等服务器相关知识,网友希望可以进行参考

Redis centos 6.4 x86_64 默认配置 如有误解 还望指正 :) )

## Generated by install_server.sh ##
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# 1k => 1000 bytes  1m  1g
# 1kb => 1024 bytes 1mb  1gb
# units are case insensitive so 1GB 1Gb 1gB are all the same.
       
daemonize yes ##是否以后台daemon方式运行
pidfile /var/run/redis_6379.pid ##守护进程模式下的 pid文件位置
port 6379 ##监听端口  设置为0则不会监听TCP socket
# bind 127.0.0.1 ##绑定接口监听连接,不设置则监听所有连接
# unixsocket /tmp/redis.sock ##用于监听连接的 unix socket
# unixsocketperm 755 ##socket 文件权限
timeout 0 ##客户端闲置N秒后自动断开连接,0为不限制 #请求超时时间
tcp-keepalive 0 ##TCP 连接存活时间,0不限制, 60(秒)
loglevel notice ##日志级别 debug(调试,大量日志信息) verbose(详细) notice(适度详细) warning(仅记录严重的信息)
logfile /var/log/redis_6379.log ##日志文件,使用stdout,日志会发送到/dev/null
# syslog-enabled no ##开启系统日志
# syslog-ident redis ##系统日志标识
# syslog-facility local0 ##系统日志用户 USER 或 LOCAL0 - LOCAL7
databases 16 ##开启的数据库数量 ,默认使用的是 0  使用SELECT <dbid>进行切换(从0开始)
save 900 1 ##跟进key变更次数,间期创建快照,保存数据到磁盘
save 300 10 ##大于10次key操作,300秒存一次盘
save 60 10000 ##大于10000次60秒;设置为 save "" 则实时存盘
stop-writes-on-bgsave-error yes ##存盘错误时禁止写入
rdbcompression yes ##使用LZF压缩存盘
rdbchecksum yes ##存盘校验 CRC64校验
dbfilename dump.rdb ##存盘数据库文件名
dir /var/lib/redis/6379  ##工作目录,(数据保存路径)
# slaveof <masterip> <masterport>  ##从服务器 上的主服务器信息
# masterauth <master-password> ##主服务器密码
slave-serve-stale-data yes ##从服务器可访问
slave-read-only yes #从服务器只读
# repl-ping-slave-period 10 ##从服务器发送ping信息  间隔10秒
# repl-timeout 60 ##超时时间
repl-disable-tcp-nodelay no ##启用小的TCP 包(系统处理会消耗部分时间)
slave-priority 100 ##从服务器优先权  越小越优先
# requirepass foobared ##使用密码,执行命令之前需要 AUTH <PASSWORD> 验证
# rename-command CONFIG b840fc02d524045429941cc15f59e41cb7be6c52 ##命令重命名
# rename-command CONFIG "" ##命令 移除  ##可能会导致从服务器有问题
# maxclients 10000 ##最大连接数  默认10000
# maxmemory <bytes>  ##内存限制
# maxmemory-policy volatile-lru ##(按近期最少用算法清理)  清理规则具体如下
## volatile-lru -> remove the key with an expire set using an LRU algorithm
## allkeys-lru -> remove any key accordingly to the LRU algorithm
## volatile-random -> remove a random key with 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 expire at all, just return an error on write operations
# maxmemory-samples 3 #LRU算法检查的key数量
appendonly no #启用AOF日志模式
# appendfilename appendonly.aof ##AOF模式 文件名
# appendfsync always ##记录全部操作
appendfsync everysec ##每秒记录一次
# appendfsync no ##不记录
no-appendfsync-on-rewrite no ##是否允许覆盖 AOF文件
auto-aof-rewrite-percentage 100 #AOF文件使用超过限制大小100%后自动覆盖
auto-aof-rewrite-min-size 64mb #AOF 文件大小限制
lua-time-limit 5000 ##Lua代码 最大执行时间 ,0为不限制
slowlog-log-slower-than 10000 ##慢执行记录
slowlog-max-len 128 ##慢执行记录最大长度
############################### 高级配置 ###############################
hash-max-ziplist-entries 512
hash-max-ziplist-value 64
list-max-ziplist-entries 512
list-max-ziplist-value 64
set-max-intset-entries 512
zset-max-ziplist-entries 128
zset-max-ziplist-value 64
activerehashing yes
## 客户端分类限制:
## normal -> normal clients
## slave  -> slave clients and MONITOR clients
## pubsub -> clients subcribed to at least one pubsub channel or pattern
## client-output-buffer-limit <class> <hard limit> <soft limit> <soft seconds>
client-output-buffer-limit normal 0 0 0
client-output-buffer-limit slave 256mb 64mb 60
client-output-buffer-limit pubsub 32mb 8mb 60
hz 10 ##键值使用频率分级
aof-rewrite-incremental-fsync yes ##间隔写入AOF文件
# include /path/to/local.conf  ##引入配置



本文出自 “微所欲为——微生活” 博客,请务必保留此出处http://vsfor.blog.51cto.com/4165449/1300185

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • Redis 默认配置精简及注释说明

相关文章

  • 远程桌面服务中的“IP虚拟化”及其作用
  • windows 2003中更换远程桌面端口
  • kb969947 Windows 内核模式驱动程序中的漏洞
  • windows服务器最基本安全权限配置方法
  • windows中IIS7.5/6开启GZip压缩
  • 检查你的电脑是否支持64位操作系统
  • mogilefs的存储节点由dead转为alive
  • Windows 2003中Rewrite组件为IIS设置伪静态
  • 电脑忘记密码之找回密码的方法大汇总
  • Windows 2003中Apache内存性能优化

文章分类

  • windows
  • 服务器硬件
  • 服务器运维
  • 云计算
  • 虚拟化
  • IIS教程
  • Linux
  • Apache
  • Ftp
  • DNS
  • Nginx

最近更新的内容

    • 软件包安装之RPM
    • Redis 默认配置精简及注释说明
    • windows2003越来越慢解决办法 可能与temp/sess_垃圾文件过多
    • windows2003 IIS6的配置备份与还原
    • rsync同步备份服务器文件参数介绍
    • Serv-U服务器安装配置图解教程(1/2)
    • linux下,查找命令的使用
    • Windows中的RunDLL32命令用法集锦
    • ganglia监控部署学习笔记分享
    • ubuntu dnsmasq配置

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有