damnabit
damnabit

Reputation: 61

Redis Ignoring directory in redis.conf

I recently installed Redis on OS X. I did an initial load of some objects, everything in this regard seems to be working perfectly.

I saved the data to dump.rdb and if I launch redis from this directory and don't use a redis.conf file everything goes according to plan.

The problem is that after settling in and setting up a redis.conf file in /etc/redis/ it seems to completely ignore the dbfilename and dir settings.

To be more clear. I created a data directory in: /Library/Redis_Data/. In the redis.conf I set dbfilename dump.rdb and dir /Library/Redis_Data

If I launch: redis-server /etc/redis/redis.conf it simply refuses to load the dump.rdb.

I've run redis-cli and can read the config parameters get config dbfilename and get config dir and they return the correct values, but no data gets restored.

I also enabled AOF. The file appendonly.aof which resides in the same directory will be recreated if I delete it and start the server again.

Lastly...if I run save from the cli it will completely wipe out and create a new dump.rdb over my data.

Any thoughts?

FYI: redis server v=2.6.9 sha=00000000:0 malloc=libc bits=64

Thanks.

Upvotes: 1

Views: 1950

Answers (1)

damnabit
damnabit

Reputation: 61

Solved: Looking back this morning on this issue I managed to discover the problem.

I originally added my data without enabling appendonly mode. After this test load I setup my environment and decided it would be great to enable appendonly.

What I discovered is this. If you have data in the dump.rdb but the appendonly.aof file is empty and appendonly is turned on; Redis will ignore the dump.rdb instead assuming there is nothing to be done because the appendonly.aof transactions don't exist.

What I did: Turned off appendonly in the config file and restarted Redis with the normal directory setup. This then loaded the dump.rdb as per my config file. I then ran the command from redis-cli config set appendonly yes followed by save.

This then created the appendonly.aof file with all the transactions. Set appendonly back to yes in the config and all was right.

Cheers, damnabit

Upvotes: 2

Related Questions