A set of Serf event handlers that helps:
- A distributed HTTP and websocket proxy like Hipache provide HTTP router services to.
- An arbitrary amount of Docker based octohost servers.
- Start up your octorouter and point your wildcard dns to it.
- Start up at least two octohosts.
- Make sure they've all joined the same Serf cluster - the octorouter should have the role of 'router' and the octohosts should be set to the 'host' role.
- Need to have proper dns or xip.io domain names.
- As the octohost servers receive a git push with website code, they:
- Build the container described in the Dockerfile.
- Launch the container with all domain names needed - including the local IP based one.
- Register with the octorouter - who then routes the HTTP requests to that particular container on that particular octohost. (Not done.)
This was built so that more than a single octohost server could be used with the same domain name.
- Proper health checking.
- Move sites from one octohost to another.
- Get container statistics from octorouter logs.
- Use encrypted Serf network.
- SSH encryption for git clone.
serf event addroute https://github.com/darron/basic-handbill-test.git,host1,http://host1.54.184.66.88.xip.io/
serf event addroute https://github.com/darron/basic-handbill-test2.git,host2,http://host2.54.184.101.227.xip.io/
On the router:
git clone https://github.com/octohost/octocluster.git /etc/serf/handlers
echo "ROLE=router" > /etc/serf/role
# Change the domain name in /etc/serf/handlers/addroute.sh
service serf restart
On the other boxes:
serf join xx.xx.xx.xx