NetWorker:當「二進位記錄」檔案不存在時,MySQL 備份會失敗

Summary: 當「二進位記錄」檔案不存在時,使用資料庫和應用程式 NetWorker 模組 (NMDA) 進行 MySQL 第一次備份時,永遠不會完成。

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Symptoms

當 MySQL 資料庫中不存在「binlog」檔案時,MySQL 的第一次備份永不結束。

 

Cause

由於 MySQL「二進位記錄」檔案不存在,因此 NetWorker 用戶端不會繼續備份活動。

重要:只有在 NetWorker 備份工作且「調試層級」等於「5」時,才會顯示有關此根本原因的證據。

從 NetWorker 用戶端,NetWorker 記錄檔 (預設位置:/nsr/logs directory) 報告遺失該 MySQL 資料庫的「二進位記錄」:

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

若要解決此問題,請清除所有先前遺失的「二進位日誌」,直到第一個「二進位日誌」可用。

重要:在下面的過程中,第一個可用的“二進位日誌”名為“mysql-bin.004585”,但這只是實驗室環境中的一個示例,用於解釋可能的解決方案。

程序

免責聲明:在執行此程序之前, Dell Technologies 建議您事先由 MySQL 系統管理員進行驗證,然後再根據您的環境套用此方法作為最佳解決方案。
  1. 以「root」使用者身分登入您的 MySQL 伺服器。

  2. 連線至 MySQL 資料庫主控台

  3. 執行下列命令,檢查「binlog」目前的可用性:

    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 |
  4. 執行下列命令,清除在第一個可用「二進位日誌」之前,所有遺失的「二進位記錄」:

    注意:在這種情況下,「mysql-bin.004585」是第一個可用的「二進位日誌」。
    mysql> purge binary logs to 'mysql-bin.004585';
    Query OK, 0 rows affected, 4584 warnings (10.12 sec)
  5. 重新執行備份工作,以驗證其是否完成且沒有發生錯誤。

    • 備份工作成功的證據 (如用戶端的 NetWorker 記錄中所示):
    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.

 

Products

NetWorker Module for Databases and Applications
Article Properties
Article Number: 000173788
Article Type: Solution
Last Modified: 06 Mar 2026
Version:  4
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.