Multiple Wamp Router forming a cluster, allowing clients to subscribe and publish to any of them
based on the simple router example
distribute Wamp router across two hosts: first-machine and second-machine
first-machine$ make
first-machine$ ./_rel/dist_wamp_router/bin/dist_wamp_router console
# now the same on second-machine
Then point your browser to http://first-machine:8080 and http://second-machine:8080, connect to the default realm, subscribe to the same topic on both machines, then publish something on that topic and watch that event appear on the other machine tadah
Also have a look at the Wamp specification for further informations on the possibilities.
- Run
make
requires a recent erlang. We suggest downloading it from here - Ensure you have
rebar
andrelx
installed and in your path. If not:wget https://raw.githubusercontent.com/wiki/rebar/rebar/rebar chmod +x rebar wget https://github.com/erlware/relx/releases/download/v1.0.2/relx chmod +x relx export PATH=$PATH:$(pwd)
- Build an RPM with
./build_rpm_with_fpm.sh
this requires fpm (gem install fpm
).
/etc/sysconfig/dist-wamp-router
USER=username-to-run-as
cd dist-yadtbroadcaster
git clone https://github.com/arnehilmann/baseimage
./init-devenv
export DOCKER_IMAGE=arne/riak
baseimage/start-dns
baseimage/start-node 1
baseimage/start-node 2
[...]
ssh node1.node.consul
cd /docker
_rel/dist_wamp_router/bin/dist_wamp_router attach
-
disable ip checking when using ssh (annoying because the ip changes with every restart of a container)
-
configure localhost in /etc/resolv.conf permanently (read: resolvconf does not remove 'localhost' as nameserver)