On 02/03/2017 08:15 AM, Stephane Gaucher wrote: > Hello I am completing a proof of concept. > > Here are the facts: > An active / passive cluster.....Done > A drbd partition for exchanging files for different services....Done > A shared VIP between the two nodes....Done > The docker/containers are functional. I do not want to use docker swarm. > This is not the purpose of this message. > > The services I develop are in the form of containers. I would like to be > able to control the docker service with pacemaker. The docker system > folders are on a drbd partition so available on the second node when it > is active. > > For the moment it works well, but I have to manually start the docker > service as well as the containers on the active node for the switch to > be effective. The server is in high availability in the hardly way. > > So is it possible to create a directive that starts the docker service > and even the container by using pacemaker.
Yes! Is it documented? No. :-( There are three types of support for containers in Pacemaker: the ocf:heartbeat:docker resource agent, running Pacemaker Remote inside a container, and Pacemaker's "resource isolation" capability. The resource agent is pretty easy to figure out from its meta-data and man page: https://www.mankier.com/7/ocf_heartbeat_docker The Pacemaker Remote documentation gives a few pointers on that approach under "Containers as Guest Nodes": http://clusterlabs.org/doc/en-US/Pacemaker/1.1-pcs/html-single/Pacemaker_Remote/index.html The resource isolation capability is probably the most interesting. The best documentation currently is the "Resource Isolation" section of this document (the "blackbox" use case it mentions is just the ocf:heartbeat:docker agent mentioned above): https://github.com/davidvossel/phd/blob/master/doc/presentations/pacemaker_remote_arch.markdown Testing and feedback on any of these methods are welcome. _______________________________________________ Users mailing list: Users@clusterlabs.org http://lists.clusterlabs.org/mailman/listinfo/users Project Home: http://www.clusterlabs.org Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf Bugs: http://bugs.clusterlabs.org