cpmdata volume disk usage growth due to binlog
Background:
In version 4.2.x, we have upgraded MySQL DB from version 5 to version 8, this changed the default parameter that determines how many binlog file to keep from 10 days to 30 days. This might result in increase in the size the MySQL DB take in the cpmdata volume.
To change this, follow the steps below
Solution:
- Take
snapshot of the CPMDATA volume before making any changes.
- SSH
into the N2WS server, user is cpmuser
- Edit the mysql config file with sudo rights
for example, with VI editor: sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
or with nano editor: sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
- search for commented “binlog_expire_logs_Seconds”
parameter
- Uncomment it and set it to 10 days. (864,000)
- Save
the changes and exit the file
- Then
restart mysql:
sudo systemctl restart mysql
- After
that make sure it’s running using the following command:
sudo systemctl status mysql
- Mysql
should now be set to keep 10 days of binlog files like previous versions.