In Redis, is it possible to set up a replication scenario where the master database is persisted to disk, but all slaves run in memory only? I have set up a redis prototype where on Server A, I have my master database. I've left the redis.conf file with the defaults as far as saving to the disk is concerned:
save 900 1
save 300 10
save 60 10000
When i run redis-cli and then check "info persistence" , is is what I see:
127.0.0.1:6379> info persistence
# Persistence
loading:0
rdb_changes_since_last_save:0
rdb_bgsave_in_progress:0
rdb_last_save_time:1471897281
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:1
rdb_current_bgsave_time_sec:-1
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
aof_last_write_status:ok
127.0.0.1:6379>
On the slave I have commented out the "save" parameters like so:
#save 900 1
#save 300 10
#save 60 10000
But... in /var/lib/redis, I do see a dump.rdb. As I test, I deleted this file... and restarted redis on the slave. Then I started up the command line interface again... and I still have data. Is this a good enough test to prove that I have successfully set up my slave just to be in memory only?
What else can I check?
I'm also going to reboot both machines and see if the system recreates a dump.rdb file on the slave.
Sorry for the noob question but this is day one for me with redis and in memory databases in general.
Thanks.
EDIT 1
- While I had the slave running, I killed the master server...
- Made sure that the slave still had records in in...
- Then i restarted redis on the slave
- Made sure that there were NO more records in the slave database...
- Restarted the master db server...
- Slave was auto populated again with all the records.
I think that's a good enough test .. unless you have other ideas.