RaftEx.Distribution (raft_ex v0.1.0)

View Source

Helpers for setting up distributed Erlang for RaftEx clusters.

Summary

Functions

Build deterministic server IDs from a list of nodes.

Return all visible cluster nodes (including self).

Connect to a list of seed nodes.

Start distributed Erlang for the current node.

Functions

build_server_ids(nodes, prefix \\ :server)

@spec build_server_ids([node()], atom()) :: [RaftEx.Types.server_id()]

Build deterministic server IDs from a list of nodes.

Nodes are sorted so every node in the cluster produces the same mapping regardless of the order in which they were supplied.

cluster_nodes()

@spec cluster_nodes() :: [node()]

Return all visible cluster nodes (including self).

connect_to_seeds(seeds, cookie \\ :raft_ex)

@spec connect_to_seeds([node()], atom()) :: [node()]

Connect to a list of seed nodes.

start(opts \\ [])

Start distributed Erlang for the current node.