Docker: is it possible to keep severalnines/centos-ssh containers configured after restart
Hi,
When running clustercontrol + Docker Swarm, if I restart the container or host node, it will loose the cluster configuration and data.
I'm able to keep the data by adding a volume as /var/lib/mysql but I'm not sure about what I can do keep everything else: installed packages, configurations etc.
Is there a recommended way to handle this?
-
Official comment
Hi Fernando,
That is one of the drawbacks running DB containers with ClusterControl. The logic behind this is ClusterControl assumes all nodes are running on a production machine setup (physical/virtual/cloud) with a dedicated IP address or hostname/FQDN.
The nature of container with orchestration particularly Swarm is a bit different, where the container IP address/hostname will be automatically generated after every container rescheduling or host restart. This would change the identity of the node because new IP address and random hostname will be allocated to the container (depending on the replicas definition) each time when being rescheduled and ClusterControl has the hard time to figure out what is what. Obviously, the safest way is to re-provision the "new" node if it sees one. If we could make the IP address or hostname consistent, ClusterControl should be able to handle it pretty well (like pretending it's a virtual machine instead).
There are a number of workarounds for now:
1) Use Kubernetes with StatefulSet (so you would get persistent hostname), for example: https://severalnines.com/blog/mysql-docker-running-galera-cluster-kubernetes (under StatefulSet section)
2) Run containers without orchestration tool, for example: https://severalnines.com/blog/mysql-docker-running-mariadb-galera-cluster-without-container-orchestration-tools-part-1I hope this gives you a clearer picture.
Regards,Ashraf
Comment actions
Please sign in to leave a comment.
Comments
1 comment