Managing the storage space
There are two storage locations where the continuous increase in disk space consumption can lead to a depletion of the available disk space on the Hyperscale host system.
1. Overlay2 File System
The /var/lib/docker/overlay2
directory stores several file system layers for images and containers, and it may also accumulate data related to unused containers and images.
To prevent excessive disk space usage caused by the Overlay2 File System, it's essential to follow the Hyperscale upgrade steps, including the deletion of dangling images as specified. If this storage becomes full, run the below command:docker rmi $(docker images -f "dangling=true" -q)
2. Container Logs
Docker maintains logs printed on the console by each service in JSON format within the /var/lib/docker/containers
directory (because the default driver is json-file). These logs keep appending to these files. If this storage becomes full, perform the below steps:
Create a
daemon.json
file under/etc/docker
directory (For more information, refer to https://docs.docker.com/config/containers/logging/local/#usage%5D & Configure logging driver). The below example describes the sample content of the file.CODE{ "log-driver": "json-file", "log-opts": { "max-size": "2g", "max-file": "3" } }
Reload & restart the docker service.
CODEsudo systemctl daemon-reload sudo systemctl restart docker
Stop all currently running docker services & then restart these again. Execute the below commands from the HS directory.
CODEdocker-compose down docker-compose up -d