NetWorker: MySQL Backup Fails When "binlog" File Does Not Exist
Summary: MySQL first backups using NetWorker Module for Databases and Applications (NMDA) never completes when the "binlog" file does not exist.
Symptoms
MySQL first backup never ends when "binlog" file does not exist in the MySQL database.
Cause
Since the MySQL "binlog" file does not exist, the NetWorker client does not continue the backup activity.
From the NetWorker client, the NetWorker log file (default location: /nsr/logs directory) reports missing "binlog" of that MySQL database:
mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.000331' does not exist. It could have been purged. PITR will not be possible from this backup. mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.000332' does not exist. It could have been purged. PITR will not be possible from this backup. mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.000333' does not exist. It could have been purged. PITR will not be possible from this backup. mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.000334' does not exist. It could have been purged. PITR will not be possible from this backup. mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.000335' does not exist. It could have been purged. PITR will not be possible from this backup. mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.000336' does not exist. It could have been purged. PITR will not be possible from this backup. mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.000337' does not exist. It could have been purged. PITR will not be possible from this backup. mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.000338' does not exist. It could have been purged. PITR will not be possible from this backup. mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.000339' does not exist. It could have been purged. PITR will not be possible from this backup. mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.000340' does not exist. It could have been purged. PITR will not be possible from this backup. mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.000341' does not exist. It could have been purged. PITR will not be possible from this backup. ... mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.004583' does not exist. It could have been purged. PITR will not be possible from this backup. mysqlbackup: WARNING: binlog file '/data/mysql/mysql-bin.004584' does not exist. It could have been purged. PITR will not be possible from this backup. 200901 14:37:32 mysqlbackup: INFO: Copying /data/mysql/mysql-bin.004585. <-- Activity log stuck in this step and backup does not send any new data.The backup job must be canceled manually or wait to timeout (in this case it was after 8 hours running). mysqlbackup: Progress in MB: 383400 mysqlbackup: ERROR: Signal 15 received.
Resolution
To address this issue, purge all previous missed "binlog" until the first "binlog" available.
Procedure
-
Log in to your MySQL server as "root" user.
-
Connect to your MySQL database console.
-
Check the current availability of "binlog" by running the following command:
mysql> show master logs; <-- Name of the DB that contains the information from the logs missed. | mysql-bin.004580 | 0 | | mysql-bin.004581 | 0 | | mysql-bin.004582 | 0 | | mysql-bin.004583 | 0 | | mysql-bin.004584 | 0 | <-- Last missed log. | mysql-bin.004585 | 1064394753 |
-
Purge all missed "binlog," previous to the first "binlog" available by running the following command:
Note: In this case, "mysql-bin.004585" is the first "binlog" available.mysql> purge binary logs to 'mysql-bin.004585'; Query OK, 0 rows affected, 4584 warnings (10.12 sec)
-
Rerun the backup job to validate that it completes without errors.
- Evidence of a successful backup job (as shown in the NetWorker logs from the client-side):
200903 09:38:14 mysqlbackup: INFO: Backup image created successfully. mysqlbackup: INFO: Image Path = sbt:MYSQL:/MySQLTest 200903 09:38:14 mysqlbackup: INFO: MySQL binlog position: filename mysql-bin.004957, position 154 ------------------------------------------------------------- Parameters Summary ------------------------------------------------------------- Start LSN : 15597868102656 End LSN : 15597868102712 ------------------------------------------------------------- mysqlbackup completed OK! with 2 warnings.