Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Current setup I have at home.

Getting mnesia running is a bit tricky.  I had to start a
node running on army an then run the script from purple.

A few times.

It eventually put everything in the right state, but I'm sure
it's fragile.  I doubt I even want disc copies.
  • Loading branch information...
commit a45e714752a38e0b67ebd7e8d0bf8fb0c74d7945 1 parent 96f524a
Dustin Sallings authored
Showing with 8 additions and 3 deletions.
  1. +2 −2 priv/configs/purple.config
  2. +6 −1 src/setup_schema.erl
4 priv/configs/purple.config
View
@@ -3,9 +3,9 @@
{error_logger, {file, "environ.log"}},
% environ is a distributed app, foo may pick it up
{distributed, [
- {env_alert, [temp@purple, {temp@foo, 'temp@dhcp-111'}]}
+ {env_alert, [temp@purple, {temp@army, 'temp@dhcp-111'}]}
]},
- {sync_nodes_optional, [temp@foo, 'temp@dhcp-111']},
+ {sync_nodes_optional, [temp@army, 'temp@dhcp-111']},
{sync_nodes_timeout, 5000}
]
}].
7 src/setup_schema.erl
View
@@ -8,12 +8,17 @@
-include("env_alert.hrl").
db_nodes () ->
- [temp@purple].
+ [temp@purple, temp@army].
init_schema() ->
+ application:start(sasl),
+ pong = net_adm:ping(temp@army),
mnesia:create_schema(db_nodes()),
ok = application:start(mnesia),
+ ok = rpc:call(temp@army, application, start, [mnesia]),
init_tables(),
+ mnesia:info(),
+ rpc:call(temp@army, mnesia, info, []),
ok = application:stop(mnesia).
init_tables() ->
Please sign in to comment.
Something went wrong with that request. Please try again.