Migrating Docker Daemons and Docker Containers

InfoScale Enterprise also addresses the use case related to migrating both the infrastructure and container data. In this scenario, you need to bring down the Docker Daemon and Docker Container on the primary node and bring them up on the secondary node.

While migrating containers, ensure that you stop the Docker Daemon and Docker Container on the primary node before you migrate them to the secondary node.

Figure: Migration of Docker Daemon and Docker Containers

Migration of Docker Daemon and Docker Containers

To configure the Docker Daemon and containers using SFCFS

  1. Create a shared disk group and volume and do mkfs.

    # vxdg -s init dockdg disk1 disk2 disk3

    # vxassist -g dockdg make vol7 10G

    # mkfs -t vxfs /dev/vx/dsk/dockdg/vol7

  2. Mount the volume on each cluster node.

    # mount -t vxfs -o cluster /dev/vx/dsk/dockdg/vol7 /docvol

    Where docvol is the directory used by the Docker Daemon for Docker infrastructure.

  3. Configure Docker to start the Docker Daemon on newly created CFS mount point, /docvol.

    Note:

    Docker stores all its data, metadata, containers on alloted CFS shares. Though this CFS share is visible on all cluster nodes, Docker Daemon should be started from only one node a time.

  4. To initialize the migration make sure Docker Daemon is stopped from the source node and CFS share is not being consumed by Docker Daemon.

    # systemctl stop docker

  5. Start the Docker Daemon on target node by appending -g /docvol in the OPTIONS field in the /etc/sysconfig/docker configuration file..

    # systemctl start docker

    The Docker Daemon is initialized on the target node. After migration is complete, Docker containers will be in exited state. User may need to manually start the containers.

Note:

To configure Docker Containers with VCS, refer to the Cluster Server Agent for Docker Installation and Configuration Guide guide.

More Information

Provisioning storage for Docker infrastructure from the Veritas File System