9 machines, 9 units
This is a Docker Swarm bundle that also includes logging and monitoring. It is comprised of the following components and features:
juju deploy observable-swarm
Any of the services provided can be scaled out post-deployment. The charms support workload status, so it is recommended to run watch juju status to monitor the cluster coming up. After it is deployed you need to grab the credentials from the lead swarm node to control the cluster:
watch juju status
juju scp swarm/0:swarm_credentials.tar .
tar xvf swarm_credentials.tar
This sets the proper environment variables to control the cluster, you can now check the state of the cluster:
Note, before running docker commands be sure docker is installed on the same machine as where you are running juju client commands from.
And then run a hello-world to launch a container in the cluster, and then checking to ensure that the container is running on the remote cluster:
docker run hello-world
docker ps -a
List all networks in the cluster:
docker network ls
List all storage in the cluster:
docker storage ls
The Kibana dashboard can display real time graphs and charts on the details of
the cluster. The Beats charms are sending metrics to the Elasticsearch and
Kibana displays the data with graphs and charts.
Get the charm's public address from the juju status command.
By default any docker container you run will automatically be spread throughout the number of swarm nodes you have deployed. We recommend no more than 30 docker containers per host if you are just using default constraints.
To add more swarm nodes to host containers:
juju add-unit swarm
or specify machine constraints:
juju add-unit swarm --constraints "cpu-cores=8 mem=32G"
Refer to the machine constraints documentation for other machine constraints that might be useful for the swarm nodes.
Consul is used for service discovery, as a key-value store, and DNS resolution for the cluster. For reliability the cluster defaults to three instances out of the box.
For more scalability, we recommend bumping up to 5 total consul nodes per model. You can add more nodes with juju add-unit consul. The consul documentation recommends 3 to 5 nodes to strike a balance between availability and performance.
juju add-unit consul
ElasticSearch is used to hold all the log data and server information logged by Beats. You can add more ES nodes by simply adding more units:
juju add-unit elasticsearch
The following issues still need to be resolved with this solution and are being worked on:
Though this will be listed in the charm store itself don't assume a user will
know that, so include that information here:
- [Bug tracker](https://github.com/juju-solutions/bundle-observable-swarm/issues)