[rabbitmq-discuss] rabbitmq server Mnesia backup and restore
brett.r.cameron at gmail.com
Wed Aug 7 04:52:20 BST 2013
You would need to backup everything under $RABBITMQ_MNESIA_DIR. This
includes both the Mnesia database (which as Emile says holds durable
configuration data) and the files used to store messages (and their
associated index files). At a quiet point (or preferably with the broker
shut down) you could hypothetically tar up the whole lot and then
subsequently restore if necessary; however it is important to note that the
Mnesia database is associated with a particular Erlang node (say
rabbit at mynode, where mynode is the name of the server on which the broker
is running), so you cannot simply copy your backup to another node, restore
it and expect things to work. There are ways to change the node name
associated with the database, but even then you may not be totally
successful. If you want to get a bit fancy you can also backup and restore
the Mnesia database using Erlang Mnesia functions like backup/1 and
restore/1. However, the simplest way to save your configuration is to use
the rabbitmqadmin tool, assuming you have the management API installed. For
example the command "rabbitmqadmin export broker.conf" will save your
configuration as a JSON document to the file broker.conf, and you could
subsequently restore it using the corresponding rabbitmqadmin import
command (you can also do these operations via the management web UI).
Instead of backing up the files used to store messages you might be better
off replicating the queues across to one or more cluster nodes.
On Wed, Aug 7, 2013 at 2:47 PM, 3k4b251 <314992959 at qq.com> wrote:
> thanks. but how to restore ? just copy back?
> View this message in context:
> Sent from the RabbitMQ mailing list archive at Nabble.com.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss