본문 바로가기

Monitoring Tools/Zabbix

4. [오류수정] zabbix DB Replication error

반응형

PRIMARY KEY 중복으로 리플 멈춤 현상

 

MariaDB [(none)]> show slave status \G;
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: {master ip}
                  Master_User: monitor-backup
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: zabbix-bin.000060
          Read_Master_Log_Pos: 102938700
               Relay_Log_File: mariadb-relay-bin.000119
                Relay_Log_Pos: 45037108
        Relay_Master_Log_File: zabbix-bin.000060
             Slave_IO_Running: Yes
            Slave_SQL_Running: No
              Replicate_Do_DB: zabbix
          Replicate_Ignore_DB:
           Replicate_Do_Table:
       Replicate_Ignore_Table:
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 1062
                   Last_Error: Error 'Duplicate entry '2299' for key 'PRIMARY'' on query. Default database: 'zabbid, type, idx2) VALUES (2299, 13, 'web.dashbrd.dashboardid', '3', 1, '0')'
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 45036823
              Relay_Log_Space: 102939325
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 1062
               Last_SQL_Error: Error 'Duplicate entry '2299' for key 'PRIMARY'' on query. Default database: 'zabbid, type, idx2) VALUES (2299, 13, 'web.dashbrd.dashboardid', '3', 1, '0')'
  Replicate_Ignore_Server_Ids:
             Master_Server_Id: 1
1 row in set (0.00 sec)
 
ERROR: No query specified
 
## 에러를 무시 옵션 추가
[root@ZABBIX-BACKUP mysql]# cat /etc/my.cnf
[mysqld]
...
slave-skip-errors       = all
...
 
 
## mariadb 재기동
## 확인
 
MariaDB [(none)]> show global variables like "%error%"
    -> ;
+--------------------+------------------------------+
| Variable_name      | Value                        |
+--------------------+------------------------------+
| log_error          | /var/log/mariadb/mariadb.log |
| max_connect_errors | 10                           |
| max_error_count    | 64                           |
| slave_skip_errors  | ALL                          |
+--------------------+------------------------------+
4 rows in set (0.00 sec)
반응형

'Monitoring Tools > Zabbix' 카테고리의 다른 글

7. [zabbix agent] varnish  (0) 2021.03.17
6. [zabbix agent] redis  (0) 2021.03.17
3. [이중화] zabbix DB replication  (0) 2021.03.17
2. zabbix Agent 환경  (0) 2021.03.17
1. zabbix server 설치  (0) 2021.03.17