refactor: update redis.conf.

This commit is contained in:
liqiang-fit2cloud 2025-07-07 10:33:00 +08:00
parent 13596ed7e8
commit 78a0a0bd50

View File

@ -6,7 +6,28 @@ mkdir -p /opt/maxkb/logs
if [ ! -f /opt/maxkb/conf/redis.conf ]; then
mkdir -p /opt/maxkb/conf
touch /opt/maxkb/conf/redis.conf
printf "bind 0.0.0.0\nport 6379\ndatabases 16\nmaxmemory 1G\nmaxmemory-policy allkeys-lru\nloglevel warning\nlogfile /opt/maxkb/logs/redis.log\ndir /opt/maxkb/data/redis\nrequirepass "${REDIS_PASSWORD}"\n" > /opt/maxkb/conf/redis.conf
cat <<EOF > /opt/maxkb/conf/redis.conf
bind 0.0.0.0
port 6379
databases 16
maxmemory 1G
aof-use-rdb-preamble yes
save 30 1
save 10 10
save 5 20
dbfilename dump.rdb
rdbcompression yes
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb
maxmemory-policy allkeys-lru
loglevel warning
logfile /opt/maxkb/logs/redis.log
dir /opt/maxkb/data/redis
requirepass ${REDIS_PASSWORD}
EOF
fi
redis-server /opt/maxkb/conf/redis.conf