docker-compose部署redis
compose配置文件
services:
redis7:
image: redis:7.4.7
container_name: redis7
ports:
- 15818:6379
networks:
redis:
volumes:
- /data/redis/data:/data
- /data/redis/conf/redis.conf:/etc/redis.conf
- /etc/localtime:/etc/localtime
command: /usr/local/bin/redis-server /etc/redis.conf
restart: always
sysctls:
- net.core.somaxconn=50000
ulimits:
nproc: 50000
nofile:
soft: 5000000
hard: 5000000
networks:
redis:
name: redisredis配置文件
bind 0.0.0.0
protected-mode yes
port 6379
tcp-backlog 1024
timeout 0
logfile "/data/redis.log"
requirepass 'SXDOi-%HcEBJZ89'
rename-command CONFIG REDIS-CONFIG
rename-command FLUSHDB REDIS-FLUSHDB
rename-command FLUSHALL REDIS-FLUSHALL
save 900 1
save 300 10
save 120 300000
stop-writes-on-bgsave-error yes
rdbcompression yes
rdbchecksum yes
dbfilename dump.rdb
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
aof-load-truncated yes
aof-use-rdb-preamble yes
slowlog-log-slower-than 10000
slowlog-max-len 1024
maxmemory 28gb
maxmemory-policy volatile-lru
maxmemory-samples 5
lazyfree-lazy-eviction yes
lazyfree-lazy-expire yes
lazyfree-lazy-server-del yes
replica-lazy-flush yes
maxclients 6000000
io-threads 8
io-threads-do-reads yes
repl-backlog-size 1gb
repl-diskless-sync yes
activerehashing yes
hz 10
tcp-keepalive 300
- 感谢你赐予我前进的力量
赞赏者名单
因为你们的支持让我意识到写文章的价值🙏
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 运维小白
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果

