Skip to content

Commit 78a0a0b

Browse files
refactor: update redis.conf.
1 parent 13596ed commit 78a0a0b

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

installer/start-redis.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,28 @@ mkdir -p /opt/maxkb/logs
66
if [ ! -f /opt/maxkb/conf/redis.conf ]; then
77
mkdir -p /opt/maxkb/conf
88
touch /opt/maxkb/conf/redis.conf
9-
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
9+
cat <<EOF > /opt/maxkb/conf/redis.conf
10+
bind 0.0.0.0
11+
port 6379
12+
databases 16
13+
maxmemory 1G
14+
aof-use-rdb-preamble yes
15+
save 30 1
16+
save 10 10
17+
save 5 20
18+
dbfilename dump.rdb
19+
rdbcompression yes
20+
appendonly yes
21+
appendfilename "appendonly.aof"
22+
appendfsync everysec
23+
auto-aof-rewrite-percentage 100
24+
auto-aof-rewrite-min-size 64mb
25+
maxmemory-policy allkeys-lru
26+
loglevel warning
27+
logfile /opt/maxkb/logs/redis.log
28+
dir /opt/maxkb/data/redis
29+
requirepass ${REDIS_PASSWORD}
30+
EOF
1031
fi
1132

1233
redis-server /opt/maxkb/conf/redis.conf

0 commit comments

Comments
 (0)