[erlang-questions] backing up stopped node?

Gleb Peregud gleber.p@REDACTED
Wed Dec 23 23:42:29 CET 2009


You can use the following commands:

erl $CTLNODENAME -noinput -noshell -eval "rpc:call($NODE, application,
stop, [ejabberd])." -s init stop
erl $CTLNODENAME -noinput -noshell -eval "rpc:call($NODE, mnesia,
backup, [\"/path/to/backup\"])." -s init stop
erl $CTLNODENAME -noinput -noshell -eval "rpc:call($NODE, application,
start, [ejabberd])." -s init stop

First command stops ejabberd inside Erlang VM, but leaves mnesia running.
Second command backups mnesia schema to /path/to/backup
Third command starts ejabberd back.

Of couse make sure to replace $CTLNODENAME with appropriate "-sname
ejabberd_ctl_node" or "-name ejabberd_ctl_node", depending on the mode
ejabberd is running (with default params first one should work). $NODE
should be node name of ejabberd server

On Wed, Dec 23, 2009 at 19:19, Jan Koum <jan.koum@REDACTED> wrote:
> hi there,
>
> we use ejabberd which uses both erlang and mnesia.  what is the best way to
> backup mnesia database without having the node running?
>
> in other words, we don't want to run 'ejabberdctl backup' on a live and
> heavily loaded ejabberd server. so we want to do 'ejabberdctl stop' first --
> however, after we stop the node, we obviously can't run 'ejabberdctl backup'
> against it.  is there a simple solution/workaround to this?
>
> thanks.
>
> -- yan
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch_ctl_app.patch
Type: text/x-diff
Size: 476 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20091223/3b077bdb/attachment.bin>


More information about the erlang-questions mailing list