-
sudo vim /etc/systemd/system/redis.service
-
Set
ReadWriteDirectories=-/mnt/data-01
-
sudo mkdir /mnt/data-01/redis
-
Set
chown
andchmod
The permissons on /var/lib/redis are 755 and it's owned by redis:redis.
The permissons on /var/lib/redis/dump.rdb are 644 and it's owned by redis:redis. -
Switch configurations while redis is running
redis-cli
127.0.0.1:6379> CONFIG SET dir /data/tmp
OK
127.0.0.1:6379> CONFIG SET dbfilename temp.rdb
OK
127.0.0.1:6379> BGSAVE
tail /var/log/redis/redis.cnf
- Alternative stop redis service and modify values in
/etc/redis/redis.cnf