liaison
Clustering and auto-reconnection of elixir nodes
Liaison aims to allow simple configuration to ensure that nodes are, and remain, connected
Installation
def deps do
[
{:liaison, "~> 0.1"}
]
endConfiguration
config :liaison,
strategies: [
[
# connect via epmd
strategy: Liaison.Strategy.Epmd,
# A list of nodes to connect to. See node expansion
nodes: []
# number of seconds between polling a connection attempt
reconnect_period: 10
]
]Node expansion
Node expansion makes connecting to other nodes easier.
Any of the following can be used with nodes
All formats can be either String.t() | atom()
| description | format | expansion |
|---|---|---|
| simple shortname | name | :name@localhost |
| simple longname | name@host | :name@host |
| simple ip longname | name@a.b.c.d | :"name@a.b.c.d |
| simple component shortname | %{name: name} | :name@localhost |
| random 6 digit shortname | %{name: :random} | :2ndel6@localhost |
| random n digit shortname | %{name: [random: 3]} | :2fk@localhost |
| component shortname | %{name: name, host: :shortname} | :name@localhost |
| component longname | %{name: name, host: :longname} | :name@w.x.y.z |
| component fullname | %{name: name, host: host} | :name@host |
| component ip fullname | %{name: name, host: a.b.c.d} | :"name@a.b.c.d |
Debug logging
To enable debug logging, add debug: true to your config
Testing
If you are having trouble testing the module, ensure that epmd is started epmd -daemon, or
iex --sname name then exit