Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I back up and restore data from a Riak cluster? What commands do I need to run?

share|improve this question

1 Answer 1

First, on each machine, you need to know a valid node name and the Erlang cookie value.

You can find out what nodes you have by running riak-admin status | grep 'nodename'

You can find the cookie name in vm.args. For me, this file was located in /usr/local/riak/etc/. There should be a line like "-setcookie foo`. The default value is 'riak'.

On the machine where you want to do the backup, run (from the docs):

sudo riak-admin backup <node> <cookie> <filename> [[node|all]]

For example:

sudo riak-admin backup rk1@192.168.10.201 MyCookieVal /home/me/riak-backup-01-11-2012.dat all

(The .dat file extension is arbitrary.)

Note that you can run this command remotely if the machine you're running it from has riak-admin available.

On the machine where you want to do the restore, run (from the docs):

riak-admin restore <node> <cookie> <filename>

For example:

riak-admin restore riak@127.0.0.1 MyCookieVal ~/riak-production-backup-01-11-2012.dat
share|improve this answer
    
Just a note on file permissions, check this thread too lists.basho.com/pipermail/riak-users_lists.basho.com/2010-May/… ! –  setsuna Sep 20 '13 at 12:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.