How to disable persistence with redis?

后端 未结 4 540
闹比i
闹比i 2021-01-30 03:06

I was wondering how to disable presistence in redis. There is mention of the possibility of doing this here: http://redis.io/topics/persistence. I mean it in the exact same sens

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-30 03:28

    As AOF (appendonly) is disabled by default, there is only one thing that is to be done for disabling persistence without redis service restart is to disable save configuration.

    For disabling it on runtime and verifying run below commands

    Check current save configuration

    pawan@devops:~$ redis-cli config get save
    1) "save"
    2) "900 1 300 10 60 10000"
    

    Same setting will be present in redis.conf file as well

    pawan@devops:~$ grep -w 'save' /etc/redis/redis.conf | grep -v '#'
    save 900 1
    save 300 10
    save 60 10000
    

    Disable save configuration

    pawan@devops:~$ redis-cli config set save ""
    OK
    

    Modify redis.conf file with the new save configuration so that the configuration remains permanent on redis service restarts

    root@ip-172-16-3-114:~# redis-cli config rewrite
    OK
    

    Confirm the new save configuration

    pawan@devops:~$ redis-cli config get save
    1) "save"
    2) ""
    

    Now if you will scan the redis.conf file for save configuration there won't be any results

    pawan@devops:~$ grep -w 'save' /etc/redis/redis.conf | grep -v '#'  
    pawan@devops:~$
    

提交回复
热议问题