https://github.com/lufte/elixir-cluster-demo
Demonstration of Elixir's RPC capabilities
https://github.com/lufte/elixir-cluster-demo
Last synced: 25 days ago
JSON representation
Demonstration of Elixir's RPC capabilities
- Host: GitHub
- URL: https://github.com/lufte/elixir-cluster-demo
- Owner: lufte
- License: gpl-3.0
- Created: 2017-05-07T07:47:29.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-08T17:32:45.000Z (about 9 years ago)
- Last Synced: 2025-03-16T19:16:18.616Z (about 1 year ago)
- Language: Elixir
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
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