MySQL docker uses too much space
This document describes how to deactivate slow_log and/or truncate output mysqldata/mysql/slow_log.CSV
file.
This option is activated by default when the mysql component is installed by devo-ea-deployer as an internal service (all in one host mode). Endpoint Agent 1.1.0 automatically fixes this issue.
Under some circumstances, this log can grow if there are a considerable number of agents enrolled and the system is running for a long period of time without purging any service. It is necessary to change this configuration and recreate the docker container to completely get rid of the issue.
You can check how much space the docker is using by running the following command:Â
|
Check how much space the MySQL docker volume is using:
To free space in the MySQL docker overlay after filling up, read on below. This procedure can be executed periodically if needed while the configuration is not completely disabled.
To disable that configuration see the related section below. Since this procedure requires devo-ea-manager services to be stopped, execute it at your convenience.
This configuration will be included in newer versions of EAM.
Notes and considerations
Bear in mind that disabling slow_log procedure implies that all devo-ea-manager services must be stopped during procedure implementation.
sudo: docker-compose: command not found error message. If you see this message when calling docker-compose command, usually it is because the /usr/local/bin path is not set in your PATH environment variable. You can temporarily fix it with the following command:
|
Truncate slow_log.CSV file procedure
If you only need free filesystem space you can truncate the main slow_log file (mysqldata/mysql/slow_log.CSV
) without stopping any service.
Run the next command based on a temporary docker container (assuming that the name of docker volume is the default configured by devo-ea-deployer):
|
Disable slow_log and truncate output file procedure
Stop all devo-ea-manager services (only one service is installed in pure all in one host):
|
Stop mysql service (host marked as service):
|
Truncate current slow_log.CSV file (assuming that the name of docker volume is the default configured by devo-ea-deployer):
|
Make a backup file and deactivate slow_log in mysql service deployed of deam-internal-services (
sed
version):
|
Recreate the mysql container and start mysql service:
|
Check mysql service status and logs of devo-ea-manager service (press Ctrl+C to stop last command):
|
Start devo-ea-manager service:
|
Check devo-ea-manager service status and logs of devo-ea-manager service (press Ctrl+C to stop last command):
|
Check in EAM Web UI that hosts are still online and events are ingested in your Devo domain:
To check that slow_log is not growing anymore you can run the next command several times, waiting a few minutes between executions (assuming that the name of docker volume is the default configured by devo-ea-deployer):
|
Disable slow_log roll-back procedure
In the unlikely event that something goes wrong, follow the rollback procedure to recover the previous version.
Stop all devo-ea-manager services (if there are any up and running):
|
Stop mysql service (if it is up and running):
|
Recover docker-compose file from the backup file (note that backup file was created with the timestamp precise to the name and hour, you might need to adapt the next command to use the right backup file name):
|
Recreate the mysql container and start mysql service:
|
Check mysql service status:
|
Check that nothing unusual shows in the logs of the MySQL service (press Ctrl+C to stop the command):
|
Start devo-ea-manager service:
|
Check devo-ea-manager service status and logs of devo-ea-manager service:
|
Check the devo-ea-manager logs and see that nothing unusual is showing up (control+C to stop the command):
|
Â