Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Use Mnesia backup on other machines
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ngocdaothanh  
View profile  
 More options Aug 31 2009, 2:32 am
From: ngocdaothanh <ngocdaoth...@gmail.com>
Date: Sun, 30 Aug 2009 23:32:17 -0700 (PDT)
Local: Mon, Aug 31 2009 2:32 am
Subject: [erlang-questions] Use Mnesia backup on other machines
Hi everyone,

I would like to ask about Mnesia backup:
1. How to periodically create backup of Mnesia DB of a node?
2. How do to copy backup files to other machines and use them there?

Regards.

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Mineiro  
View profile  
 More options Aug 31 2009, 12:43 pm
From: Paul Mineiro <paul-trape...@mineiro.com>
Date: Mon, 31 Aug 2009 09:43:29 -0700 (PDT)
Local: Mon, Aug 31 2009 12:43 pm
Subject: Re: [erlang-questions] Use Mnesia backup on other machines
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

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Raschke  
View profile  
 More options Aug 31 2009, 1:34 pm
From: Robert Raschke <rtrli...@googlemail.com>
Date: Mon, 31 Aug 2009 18:34:47 +0100
Local: Mon, Aug 31 2009 1:34 pm
Subject: Re: [erlang-questions] Use Mnesia backup on other machines

On Mon, Aug 31, 2009 at 5:43 PM, Paul Mineiro <paul-trape...@mineiro.com>wrote:

No need for the timer though, just use the gen_server's own timeout return
value. Combine this with calculating a timeout value using the
until_next_time() function from crone and you can have nicely scheduled
backups.

Minimal, untested and not even compiled example, started with something like
mybackup:start_link("DB.BAK", {daily, {every, {1, hr}, {between, {12, 0, 0,
am}, {11, 59, 59, pm}}}}) .

-module(mybackup).

-behaviour(gen_server).

-export([start_link/2, init/1, handle_info/2]).

start_link(Backup_File, Backup_When) ->
    gen_server:start_link({local, ?MODULE}, ?MODULE, [Backup_File,
Backup_When], []).

init([Backup_File, Backup_When]) ->
    {ok, {Backup_File, Backup_When},
1000*crone:until_next_time(Backup_When)}.

handle_info(timeout, {Backup_File, Backup_When} = State) ->
    mnesia:backup(Backup_File),
    % HACK: Just in case it took less than a second, make sure we don't do
it again right away.
    timer:sleep(1000),
    {noreply, State, 1000*crone:until_next_time(Backup_When)}.

Robby


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ngocdaothanh  
View profile  
 More options Aug 31 2009, 10:53 pm
From: ngocdaothanh <ngocdaoth...@gmail.com>
Date: Mon, 31 Aug 2009 19:53:26 -0700 (PDT)
Local: Mon, Aug 31 2009 10:53 pm
Subject: [erlang-questions] Re: Use Mnesia backup on other machines
Thank you for the answers.

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

I mean for a same version of Erlang, is the default backup file cross-
platform and can be restored anywhere just like a PostgreSQL backup
file? How can I create backup file on a remote server running Ubuntu,
then restore it to my local Snow Leopard laptop? I heard somewhere
that once created a Mnesia DB will be fixed to a node name, simply
copying it doesn't work.

> until_next_time() function from crone

crone is very interesting. Where can I find the latest version of it?

Regards.

On Sep 1, 2:34 am, Robert Raschke <rtrli...@googlemail.com> wrote:

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chandru  
View profile  
 More options Sep 1 2009, 6:08 am
From: Chandru <chandrashekhar.mullapar...@gmail.com>
Date: Tue, 1 Sep 2009 11:08:16 +0100
Local: Tues, Sep 1 2009 6:08 am
Subject: Re: [erlang-questions] Re: Use Mnesia backup on other machines

2009/9/1 ngocdaothanh <ngocdaoth...@gmail.com>

> Thank you for the answers.

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

> I mean for a same version of Erlang, is the default backup file cross-
> platform and can be restored anywhere just like a PostgreSQL backup
> file? How can I create backup file on a remote server running Ubuntu,
> then restore it to my local Snow Leopard laptop? I heard somewhere
> that once created a Mnesia DB will be fixed to a node name, simply
> copying it doesn't work.

If you just want the contents of some/all tables restored, you can use the
backup anywhere. If you want the entire database rebuilt from scratch using
the backup, the node names have to match. There is a way to change node
names in the backup file if you need the latter. Refer to the Mnesia user
guide for details.

cheers
Chandru


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »