Docker Issues
Troubleshoot Docker storage, network, and service startup problems on HEAL servers.
Docker Issues#
Below are the troubleshooting of docker issues:
- Issue with Corrupted Storage Driver
- Docker Network Driver Issue
- Docker Service Startup Issue on Heal Server
- Relocating the Docker Root Directory
For reference:
The following section contains basic Linux commands: Basic Commands
Issue with Corrupted Storage Driver#
The storage driver in the Docker configuration is corrupted.
Solution:
-
Daemon Configuration File Creation:
-
Create a daemon.json file in the below directory
/etc/docker -
Change the storage driver from overlay2 to devicemapper.
{ "data-root": "/apmt/data/docker_lib_new", "storage-driver": "devicemapper" }
-
-
Docker Service File Modification: Edit the docker.service file to remove the old device directory specification (from -g to -H).
-
Daemon Reload and Docker Restart:
-
Reloaded system daemons,
systemctl daemon-reload -
Restarted the Docker service,
systemctl restart docker
-
-
Service Restart and Verification: Restart all the services and verify that they are up and running.
Docker Network Driver Issue#
Suspected Docker network glitch causing services to go down, with the default network being "docker0" bridge network.
Solution:
-
Network Deletion and Recreation: Delete the existing "docker0" network and created a new "zdocker0" network:
ip link del docker0 docker network create --driver=bridge -o "com.docker.network.bridge.name=zdocker0" zdocker0 -
Directory Deletion and Service Restart:
- Delete the "nomad" directory to prevent the service from accessing old allocation IDs.
- Restart the Docker, Nomad, and Consul services.
Docker Service Startup Issue on Heal Server#
Unable to start the Docker service on the Heal server. The service fails and stops repeatedly, as shown in the journalctl logs.
Error Log:
Mar 14 18:13:58 healdb systemd[1]: docker.service failed.
Mar 14 18:14:00 healdb systemd[1]: docker.service holdoff time over, scheduling restart.
Mar 14 18:14:00 healdb systemd[1]: Stopped Docker Application Container Engine.
Solution:
- Disk Mounting Issue Resolution:
- The issue was caused by a non-permanently mounted disk on the Heal server.
- The mount point was permanently added and restarted the server to implement this change.
- Service Restart: After the server restart, the HEAL services were started, restoring UI functionality and data visibility.
- SELinux Status Adjustment: The SELinux status was set to 'permissive' on both the HEAL App and DB servers to facilitate smoother operation.
Relocating the Docker Root Directory#
When the Docker root directory lacks adequate file space, relocation is necessary.
Procedure:
-
Stop Docker Services: Execute the following commands to stop Docker and related services:
sudo systemctl stop docker sudo systemctl stop docker.socket sudo systemctl stop containerd -
Create New Directory Structure: Ensure the new directory has at least 50 GB of free disk space. More may be required based on ingestion volumes and retention policy:
sudo mkdir -p /new_dir_structure -
Move Docker Root: Relocate the Docker root to the newly created directory:
sudo mv -
Edit Daemon Configuration:
-
Modify or create the /etc/docker/daemon.json file,
sudo vim /etc/docker/daemon.json -
Add the following content:
{ "data-root": "/new_dir_structure/docker" }
-
-
Restart Docker Services: Restart the Docker to apply the changes:
sudo systemctl start docker -
Validation: Confirm the new Docker root location:
docker info -f '{{ .DockerRootDir}}'