Difference between original and old conf file in redis

482 Views Asked by At

What is difference between original and old conf file in redis and what is location of old file persisted in redis server.

I have read about that in config rewrite command in redis documentation.

URL :- https://redis.io/commands/config-rewrite

1

There are 1 best solutions below

2
On

Redis has a single config file. But if you set few configs, using redis-cli> CONFIG SET command, then you need to either use CONFIG REWRITE to make sure all those changes reflect in redis.conf file or you manually update redis.conf file with the same changes. If you don't do anyone the steps, the next time when you restart redis, the old config would be picked up as redis.conf doesn't change automatically.

Make sure to also modify the redis.conf file accordingly to the configuration you set using CONFIG SET. You can do it manually, or starting with Redis 2.8, you can just use CONFIG REWRITE, which will automatically scan your redis.conf file and update the fields which don't match the current configuration value. Fields non existing but set to the default value are not added. Comments inside your configuration file are retained.

Reference - https://redis.io/topics/config

Also, the file location by default usually is /etc/redis.conf. When you install redis from source, you get default redis.conf as well in that pkg.