Beethoven

A Decentralized failover and peer-to-peer node finder for Elixir. Allows Elixir nodes to find each other automatically. Once connected, they can coordinate to delegate roles and tasks between the nodes in the cluster. Written using only the Elixir and Erlang standard library.

How to use

Within mix.exs, add the below to deps/0.

defp deps do
[
...
{:beethoven, "~> 0.0"}
...
]
end

Add :beethoven to :extra_applications for your application/0 config within mix.exs.

def application do
[
mod: {..., []},
extra_applications: [:logger, :runtime_tools, :beethoven]
]
end

Add dependencies via mix in a shell session.

$> mix Deps.get

Then within config.exs, or your preferred config file, input the below config.

# Configuration for the Beethoven stack
config :beethoven,
use_az_net: false,
cluster_net: "127.0.0.0",
cluster_net_mask: "29",
listener_port: 3000,
roles: [
# {<AtomName>, <Module>, <Initial Args>, <InstanceCount>}
{:test, Beethoven.TestRole, [arg1: "arg1"], 2},
{:testd, Beethoven.TestdRole, [arg1: "arg1"], 2}
]

This configuration uses the 2 test servers, Beethoven.TestRole and Beethoven.TestdRole.

Lets break down the configuration as a whole:

Role definition

Defining a role for Beethoven to track uses this following schema:

# {<AtomName>, <Module>, <Initial Args>, <InstanceCount>}
{:test, Beethoven.TestRole, [arg1: "arg1"], 2}

Notes on InstanceCount

Now, once you start your Mix Application, your role should spawn once Beethoven.RoleServer has initialized.

Any issues?

Please run your app with the environmental variable MIX_ENV set to dev, and create an issue on the Github repo for Beethoven.