UnisKB/installer/start-redis.sh

33 lines
676 B
Bash
Raw Normal View History

2025-04-18 06:10:16 +00:00
#!/bin/bash
mkdir -p /opt/maxkb/data/redis
2025-07-03 07:15:34 +00:00
mkdir -p /opt/maxkb/logs
2025-04-18 06:10:16 +00:00
if [ ! -f /opt/maxkb/conf/redis.conf ]; then
mkdir -p /opt/maxkb/conf
touch /opt/maxkb/conf/redis.conf
2025-07-07 02:33:00 +00:00
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
2025-04-18 06:10:16 +00:00
fi
2025-04-21 07:39:29 +00:00
redis-server /opt/maxkb/conf/redis.conf