first commit
This commit is contained in:
+73
@@ -0,0 +1,73 @@
|
||||
# Redis服务器配置
|
||||
|
||||
# 绑定IP地址
|
||||
#解除本地限制 注释bind 127.0.0.1
|
||||
#bind 127.0.0.1
|
||||
# 服务器端口号
|
||||
port 6379
|
||||
#配置密码,不要可以删掉
|
||||
# 设置当前数据库不是任何数据库的从库
|
||||
replicaof no one
|
||||
#这个配置不要会和docker -d 命令 冲突
|
||||
# 服务器运行模式,Redis以守护进程方式运行,默认为no,改为yes意为以守护进程方式启动,可后台运行,除非kill进程,改为yes会使配置文件方式启动redis失败,如果后面redis启动失败,就将这个注释掉
|
||||
daemonize no
|
||||
#当Redis以守护进程方式运行时,Redis默认会把pid写入/var/run/redis.pid文件,可以通过pidfile指定(自定义)
|
||||
#pidfile /data/dockerData/redis/run/redis6379.pid
|
||||
#默认为no,redis持久化,可以改为yes
|
||||
appendonly yes
|
||||
#当客户端闲置多长时间后关闭连接,如果指定为0,表示关闭该功能 # 增加到300秒,或设为0禁用
|
||||
timeout 300
|
||||
# 服务器系统默认配置参数影响 Redis 的应用
|
||||
maxclients 10000
|
||||
# 减少到60秒,更快检测连接问题
|
||||
tcp-keepalive 60
|
||||
#指定在多长时间内,有多少次更新操作,就将数据同步到数据文件,可以多个条件配合(分别表示900秒(15分钟)内有1个更改,300秒(5分钟)内有10个更改以及60秒内有10000个更改)
|
||||
save 900 1
|
||||
save 300 10
|
||||
save 60 10000
|
||||
# 按需求调整 Redis 线程数
|
||||
tcp-backlog 511
|
||||
# 设置Redis副本实例是否为只读模式
|
||||
# no:副本实例可以进行写操作,这在某些场景下可以分担主实例的压力,但需要谨慎使用以避免数据不一致
|
||||
replica-read-only no
|
||||
|
||||
# 设置Redis最大内存达到时的数据淘汰策略
|
||||
# noeviction:当内存达到最大限制时,Redis不会自动删除任何键,这可能导致进一步的操作失败,直到手动干预 # 当内存不足时,删除最近最少使用的键
|
||||
maxmemory-policy noeviction
|
||||
# 设置数据库数量,这里设置为16个数据库
|
||||
databases 16
|
||||
# 启用 AOF, AOF常规配置
|
||||
appendonly yes
|
||||
# 改为由操作系统决定何时同步,减少I/O压力
|
||||
appendfsync no
|
||||
no-appendfsync-on-rewrite no
|
||||
auto-aof-rewrite-percentage 100
|
||||
auto-aof-rewrite-min-size 64mb
|
||||
# 慢查询阈值
|
||||
slowlog-log-slower-than 10000
|
||||
slowlog-max-len 128
|
||||
|
||||
# 以系统日志的方式输出日志
|
||||
# syslog-enabled yes
|
||||
|
||||
#指定日志记录级别,Redis总共支持四个级别:debug、verbose、notice、warning,默认为verbose
|
||||
# loglevel verbose
|
||||
|
||||
# 日志输出文件,默认为stdout,也可以指定文件路径
|
||||
# logfile stdout
|
||||
|
||||
# 日志文件
|
||||
#logfile /var/log/redis/redis-server.log
|
||||
|
||||
# 系统内存调优参数
|
||||
# 按需求设置
|
||||
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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user