-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
37 lines (23 loc) · 907 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
With Docker
-----------
Create a network so containers can see each other
docker network create elixir
For each node, run the following replacing NAME with a unique name
docker run -ti --net=elixir -w /root -v $PWD:/root elixir iex --sname NAME node.ex
Put each node's name (NAME@container-id) in hosts
Now create run the host
docker run -ti --net=elixir -w /root -v $PWD:/root elixir iex --sname host cluster.ex
From the host shell, execute
import_file "node.ex"
Cluster.run
In a local network
------------------
For each host
Create the cookie: echo 123 > ~/.erlang.cookie && chmod 700 ~/.erlang.cookie
Create the source file with the content of node.ex
Run the shell: iex --name NAME@hostname node.ex
Put each node's name (NAME@hostname) in hosts
Run the host shell: iex --name host@hostname cluster.ex
From the host shell, execute
import_file "node.ex"
Cluster.run