To change redis data dir

1,547 views
Skip to first unread message

Raju Divakaran

unread,
Nov 28, 2016, 12:44:07 PM11/28/16
to Redis DB
Hello,

Currently I am having a redis stand alone, which is having around 1 million keys. So at present there are slowness and intermittent downtime. 

So I am moving redis to use local SSDs. I am already having SSDs ready. 

Can anyone please suggest me the safest and most seamless way of moving the data store of Redis to SSDs. ( with as much less downtime as possible ).

Thanks,

Raju.

Itamar Haber

unread,
Nov 28, 2016, 2:48:30 PM11/28/16
to Redis DB
Hi Raju,

Redis' `data` configuration directive is the path in which the persisted data files (AOF and RDB) are stored. You can issue a `config set data /ssd/mount/point` while the server is up to direct new files to that target.

Make sure that you do not forget to persist this configuration change either by manually editing the redis.conf file or by issuing a `config rewrite` command, or the next time that the server is restarted it'll go back to the previous setting.

P.S. naturally, don't take any advice at face value, and test this in an environment similar to yours before moving to production.

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.



--

Itamar Haber | Chief Developer Advocate
Redis Labs ~/redis

Mobile: +972 (54) 567 9692
Email: ita...@redislabs.com
Twitter: @itamarhaber
Skype: itamar.haber

Blog  |  Twitter  |  LinkedIn


Raju Divakaran

unread,
Nov 30, 2016, 11:06:02 AM11/30/16
to Redis DB
Hello Haber,

Thanks much for the reply. I will surely test this before doing against production as am already having some bad experiences by following the doc blindly! :)

Just wanted to check whether you had tried this. So once I change the data store on the fly, redis will serve requests coming to from its in memory data and just that new data ( rdb snapshots and aof file )will be written to the new location correct !?

Raju.


On Monday, November 28, 2016 at 8:48:30 PM UTC+1, Itamar Haber wrote:
Hi Raju,

Redis' `data` configuration directive is the path in which the persisted data files (AOF and RDB) are stored. You can issue a `config set data /ssd/mount/point` while the server is up to direct new files to that target.

Make sure that you do not forget to persist this configuration change either by manually editing the redis.conf file or by issuing a `config rewrite` command, or the next time that the server is restarted it'll go back to the previous setting.

P.S. naturally, don't take any advice at face value, and test this in an environment similar to yours before moving to production.
On Mon, Nov 28, 2016 at 7:41 PM, Raju Divakaran <rajudi...@gmail.com> wrote:
Hello,

Currently I am having a redis stand alone, which is having around 1 million keys. So at present there are slowness and intermittent downtime. 

So I am moving redis to use local SSDs. I am already having SSDs ready. 

Can anyone please suggest me the safest and most seamless way of moving the data store of Redis to SSDs. ( with as much less downtime as possible ).

Thanks,

Raju.

--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+u...@googlegroups.com.

To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Itamar Haber

unread,
Nov 30, 2016, 11:16:00 AM11/30/16
to Redis DB

I tried it and it works for me ;)

Redis always serves data from memory, regardless of persistence settings. Your understanding is correct, although there is one subtlety to note: the old AOF file will remain in use until a rewrite happens - only then will the old one be closed and a new file will be created in the updated directory.


To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+unsubscribe@googlegroups.com.

Raju Divakaran

unread,
Nov 30, 2016, 12:40:46 PM11/30/16
to Redis DB
Thank you and am confident now! :) I just made a new post with few doubts on master slave setup.. please have a look when you have time. I am sure you can give me some tips there as well.

Raju.
Reply all
Reply to author
Forward
0 new messages