[ejabberd] backing up stopped node?
badlop at gmail.com
Thu Dec 24 18:04:09 MSK 2009
2009/12/23 Jan Koum <jan.koum at gmail.com>:
> 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 dilema?
What about not allowing XMPP connections to ejabberd during backup?
There are at least four ways to backup ejabberd's Mnesia database.
Sorted from more efficient to less efficient:
1. tar -czvf backup-2009-12-23-19-44.tgz /var/lib/ejabberd
2. ejabberdctl backup file
3. ejabberdctl dump file
4. ejabberdctl export_piefxis dir
For example, at 6AM every day:
monday-saturday: method 1.
sunday: method 2.
On sunday, to apply 2 with your additional constrain, you can do this:
5AM: stop the 5222 c2s listener port, so not more connections will be granted.
6AM: send announcement that the server will be stopped
605AM: restart ejabberd with all ports closed, backup using method 2,
restart ejabberd with all ports opened.
Maybe all this can be automated using cron, a shell script and ejabberdctl.
More information about the ejabberd