Module jc_cluster

Either Joins an existing Mnesia cluster, copying tables over to this replica; or create the first node of the cluster and creates relevant tables.

Copyright © (C) 2015, Jim Rosenblum

Authors: Jim Rosenblum (jrosenblum@jims-mbp.jhs.local).

Description

Either Joins an existing Mnesia cluster, copying tables over to this replica; or create the first node of the cluster and creates relevant tables. Created tables: Desiged to create a diskless cluster (schema is RAM and all tables in RAM) therefore sys.config MUST CONTAIN {schema_location, ram}.

Data Types

cluster_id()

cluster_id() = node()

Function Index

change_cluster_id/0Change the cluster_id: used when a Node that had been the ClusterId Node of record dies.
check/1If this node doesn't have the same ClusterId as the supplied one, its an indciation of a net-join of a orphaned or island node.
get_cluster_id/0Return the current cluster_id or no_exists if this Node hasn't made it through mnesia cluster creation / join.
init/0Either join an existing Mnesia cluster or start one, creating the tables as appropriate.

Function Details

change_cluster_id/0

change_cluster_id() -> ok

Change the cluster_id: used when a Node that had been the ClusterId Node of record dies.

check/1

check(ClusterId::cluster_id()) -> good | bad

If this node doesn't have the same ClusterId as the supplied one, its an indciation of a net-join of a orphaned or island node. Likey to have consistancy issues. Kill oneself and be restarted by the heartbeat.

get_cluster_id/0

get_cluster_id() -> cluster_id() | no_exists

Return the current cluster_id or no_exists if this Node hasn't made it through mnesia cluster creation / join.

init/0

init() -> ok

Either join an existing Mnesia cluster or start one, creating the tables as appropriate. Notice that sys.config MUST contain {schema_location, ram}.


Generated by EDoc, Sep 7 2016, 09:32:13.