mcc v1.0.1 Mcc.Lib
This module contains functions to manipulate cluster based on mnesia.
Includes:
- 1, start mnesia and mnesia table
- 2, make node join into the mnesia cluster
- 3, make node leave from the mnesia cluster
- 4, remove one node from mnesia cluster
- 5, get status of mnesia cluster
Link to this section Summary
Functions
Get all nodes in current mnesia cluster
Copy mnesia table from remote node
Create mnesia table
Delete schema copy of given node
Delete schema information in local node
Ensure mnesia stoppted
Make one node join into the mnesia cluster
Make one node leave from the mnesia cluster
Get all not running nodes in current mnesia cluster
Remove one node from the mnesia cluster
Get all running nodes in current mnesia cluster
Tries to start mnesia and create or copy mnesia table.
It will raises an exception in case of failure, return :ok
if successful,
or {:error, reason}
if an error occurs
Get status of the mnesia cluster
Link to this section Functions
all_nodes()
all_nodes() :: [node()]
all_nodes() :: [node()]
Get all nodes in current mnesia cluster.
copy_table(name, ram_or_disc \\ :ram_copies)
Copy mnesia table from remote node.
create_table(name, tabdef)
Create mnesia table.
del_schema_copy(node_name)
Delete schema copy of given node.
delete_schema()
delete_schema() :: :ok | {:error, any()}
delete_schema() :: :ok | {:error, any()}
Delete schema information in local node.
ensure_stopped()
ensure_stopped() :: :ok | {:error, any()}
ensure_stopped() :: :ok | {:error, any()}
Ensure mnesia stoppted.
join_cluster(node_name)
Make one node join into the mnesia cluster.
leave_cluster()
leave_cluster() ::
:ok | {:error, :node_not_in_cluster} | {:error, {:failed_to_leave, node()}}
leave_cluster() :: :ok | {:error, :node_not_in_cluster} | {:error, {:failed_to_leave, node()}}
Make one node leave from the mnesia cluster.
not_running_nodes()
not_running_nodes() :: [node()]
not_running_nodes() :: [node()]
Get all not running nodes in current mnesia cluster.
remove_from_cluster(node_name)
Remove one node from the mnesia cluster.
running_nodes()
running_nodes() :: [node()]
running_nodes() :: [node()]
Get all running nodes in current mnesia cluster.
start()
start() :: :ok | {:error, term()}
start() :: :ok | {:error, term()}
Tries to start mnesia and create or copy mnesia table.
It will raises an exception in case of failure, return :ok
if successful,
or {:error, reason}
if an error occurs.
status()
status() :: list()
status() :: list()
Get status of the mnesia cluster.