[erlang-questions] Use Mnesia backup on other machines

Paul Mineiro paul-trapexit@REDACTED
Mon Aug 31 18:43:29 CEST 2009


Inline.

-- p

On Sun, 30 Aug 2009, ngocdaothanh wrote:

> Hi everyone,
>
> I would like to ask about Mnesia backup:
> 1. How to periodically create backup of Mnesia DB of a node?

You can have a gen_server which uses timer:send_interval/2 combined with
handle_info/2 to trigger the backups.  You can back up everything with
mnesia:backup/1.  In case the backup takes a very long time you should
twiddle something in the gen_server state to prevent starting a new backup
while an old one is happening.

> 2. How do to copy backup files to other machines and use them there?

Is this about the actual file movement, or about whether a mnesia backup
done on cluster A can be restored on cluster B?

On EC2, I store the backups on S3 via s3fs, then use mnesia:restore/2 when
I want to restore the backup.  I haven't tried to restore a backup on a
cluster when all the node names have changed from when the backup was
performed.

-- p


More information about the erlang-questions mailing list