Stopping a delegate host
Use this procedure to stop the Control Center service
(serviced) on a delegate host in a multi-host deployment. Repeat this
procedure on each delegate host in your deployment.
- Log in to the delegate host as root, or as a user with superuser privileges.
-
Stop the Control Center service.
systemctl stop serviced
-
Ensure that no containers remain in the local repository.
-
Display the identifiers of all containers, running and exited.
docker ps -qa
- If the command returns no result, proceed to the next step.
- If the command returns a result, perform the following substeps.
-
Remove all remaining containers.
docker ps -qa | xargs --no-run-if-empty docker rm -fv
- If the remove command completes, proceed to the next step.
- If the remove command does not complete, the most likely cause is an NFS conflict. Perform the following substeps.
-
Stop the NFS and Docker services.
systemctl stop nfs && systemctl stop docker
-
Start the NFS and Docker services.
systemctl start nfs && systemctl start docker
-
Repeat the attempt to remove all remaining containers.
docker ps -qa | xargs --no-run-if-empty docker rm -fv
- If the remove command completes, proceed to the next step.
- If the remove command does not complete, perform the remaining substeps.
-
Disable the automatic startup of serviced.
systemctl disable serviced
-
Reboot the host.
reboot
- Log in to the delegate host as root, or as a user with superuser privileges.
-
Enable the automatic startup of serviced.
systemctl enable serviced
-
Display the identifiers of all containers, running and exited.
-
Dismount all filesystems mounted from the Control Center master host.
This step ensures no stale mounts remain when the storage on the master host is replaced.
-
Identify filesystems mounted from the master host.
awk '/serviced/ { print $1, $2 }' < /proc/mounts \ | grep -v '/opt/serviced/var/isvcs'
- If the preceding command returns no result, stop. This procedure is complete.
- If the preceding command returns a result, perform the following substeps.
-
Force the filesystems to dismount.
for FS in $(awk '/serviced/ { print $2 }' < /proc/mounts \ | grep -v '/opt/serviced/var/isvcs') do umount -f $FS done
-
Identify filesystems mounted from the master host.
awk '/serviced/ { print $1, $2 }' < /proc/mounts \ | grep -v '/opt/serviced/var/isvcs'
- If the preceding command returns no result, stop. This procedure is complete.
- If the preceding command returns a result, perform the following substeps.
-
Perform a lazy dismount.
for FS in $(awk '/serviced/ { print $2 }' < /proc/mounts \ | grep -v '/opt/serviced/var/isvcs') do umount -f -l $FS done
-
Restart the NFS service.
systemctl restart nfs
-
Determine whether any filesystems remain mounted from the master host.
awk '/serviced/ { print $1, $2 }' < /proc/mounts \ | grep -v '/opt/serviced/var/isvcs'
- If the preceding command returns no result, stop. This procedure is complete.
- If the preceding command returns a result, perform the remaining substeps.
-
Disable the automatic startup of serviced.
systemctl disable serviced
-
Reboot the host.
reboot
- Log in to the delegate host as root, or as a user with superuser privileges.
-
Enable the automatic startup of serviced.
systemctl enable serviced
-
Identify filesystems mounted from the master host.