By William Le.
If you’ve been keeping up with the news here at ACA, you’ll know that we use Docker to containerize all our services for rapid deployment. For any single deployment of our web applications, we may have a cluster of between 3 to over a dozen CoreOS nodes each running REST-based services inside of Docker containers.
So how do we monitor the health of all these services when they’re all running on different servers? Here I’ll very briefly introduce 3 different options for you. The good news is that they’re all free, deployable as Docker containers and easy to set up.
1. Rancher
I’ll start with the newest and most exciting option. Rancher is actually a complete platform for operating and managing Docker services and service monitoring is actually just one of its many features. While the idea is to deploy and manage your entire cluster of containerised services using the Rancher Web Interface or Rancher Compose file, we’ve found that it just doesn’t offer the level of flexibility that we need that CoreOS offers with fleet and etcd.
But that’s OK! You can still use Rancher to monitor host and container health as well as view container logs and perform basic container management, all with just these two steps:
Start a single Rancher Management Server:
docker run -d --restart=always -p 8080:8080 rancher/server
Run the Rancher Agent on each host (example only):
sudo docker run -d --privileged -v /var/run/docker.sock:/var/run/docker.sock rancher/agent:v0.7.9 http://<span class="cm-tag cm-bracket"><</span><span class="cm-tag">ManagementServerIP</span><span class="cm-tag cm-bracket">></span>:8080/v1/scripts/C799D5A9F3671B2A48FE:1234939100000:UztzC0Yc3Bfg1liXAwZk3hLhGre
Below are some images of the Rancher Web UI of one of our small dev clusters.
2. Watchmen
Watchmen is a super simple web service monitor with not much to it - and that’s why we like it! To get started you just need to specify the services you want the daemon to monitor by editing a couple config files as described on their homepage.
Drop that and any other config files you wish to specify into a directory on the server and run one of the containers that already exist:
docker run -d -v=/watchmen-config:/srv/watchmen/config --name=watchmen -p 3000:3000 sroegner/watchmen
3. Consul
Consul is a much more sophisticated and popular option that is more than just service monitoring. Usually this makes it more difficult and time consuming to deploy - but fortunately some kind soul has created a very elegant Docker image to start you off:
docker run -p 8400:8400 -p 8500:8500 -p 8600:53/udp -h node1 progrium/consul -server -bootstrap -ui-dir /ui
There are literally hundreds of other options including popular open-source frameworks such as Sensu and older platforms such as Nagios. I’ve presented these three as they illustrate the varying complexities of the tools available and they are very current projects that are easy to deploy with Docker. Happy service monitoring!