HI:
I am setting up replication single master -> slave . On replciation I am getting duplicate keyes on the visitors table. Just wondering if this has to do with this module and its tables and Primary key.
Thanks
Tom
show slave status \G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.1.50
Master_User: acap_slave_user
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000014
Read_Master_Log_Pos: 106
Relay_Log_File: acap-server1-relay-bin.000047
Relay_Log_Pos: 527605
Relay_Master_Log_File: mysql-bin.000007
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB: antarctica
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 '18833' for key 'PRIMARY'' on query. Default database: 'antarctica'. Query: 'INSERT INTO visitors
(
visitors_uid,
visitors_ip,
visitors_date_time,
visitors_url,
visitors_referer,
visitors_path,
visitors_title,
visitors_user_agent
)
VALUES
(
'10',
'2917409552',
1335565599,
'http://69.12.217.242/',
'',
'project/current',
'User Current Active Project Redirect',
'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19'
)'
Skip_Counter: 0
Exec_Master_Log_Pos: 66926055
Relay_Log_Space: 99279382
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 '18833' for key 'PRIMARY'' on query. Default database: 'antarctica'. Query: 'INSERT INTO visitors
(
visitors_uid,
visitors_ip,
visitors_date_time,
visitors_url,
visitors_referer,
visitors_path,
visitors_title,
visitors_user_agent
)
VALUES
(
'10',
'2917409552',
1335565599,
'http://69.12.217.242/',
'',
'project/current',
'User Current Active Project Redirect',
'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19'
)'
1 row in set (0.02 sec)
Comments
Comment #1
gashev commentedComment #2
gashev commentedExcuse, I cannot reproduce this issue. I set replication and it work correctly.
On the master:
mysql> show master status\G
*************************** 1. row ***************************
File: mysql-bin.000003
Position: 97184
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)
mysql> select count(*) from drupal6.visitors;
+----------+
| count(*) |
+----------+
| 13 |
+----------+
1 row in set (0.00 sec)
On the slave:
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.0.0.4
Master_User: replication
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000003
Read_Master_Log_Pos: 97184
Relay_Log_File: mysql-relay-bin.000004
Relay_Log_Pos: 97329
Relay_Master_Log_File: mysql-bin.000003
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: drupal6
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 97184
Relay_Log_Space: 97629
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: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)
mysql> select count(*) from drupal6.visitors;
+----------+
| count(*) |
+----------+
| 13 |
+----------+
1 row in set (0.00 sec)
If you can reproduce the issue - send me steps to reproduce.
Thank you.
Comment #3
gashev commentedComment #4
hts_gnaw commentedI'm also getting this issue where MySql replication is throwing duplicate entry errors for some tables that seem pretty important. Specifically, I'm seeing errors on the following tables:
variable
role
queue
Error 'Duplicate entry 'javascript_parsed' for key 'PRIMARY'' on query. Default database: 'testdb'. Query: 'INSERT INTO variable (name, value) VALUES ('javascript_parsed', 'a:2:{s:15:\"refresh:zh-hans\";s:7:\"waiting\";s:15:\"refresh:zh-hant\";s:7:\"waiting\";}')'
Error 'Duplicate entry '4-auto-publish 1bf discussion topic without approval' for key 'PRIMARY'' on query. Default database: 'halfthesky'. Query: 'INSERT INTO role_permission (rid, permission, module) VALUES ('4', '', '')'
I'm using Drupal 7. Would it make sense to add these 3 tables to the ignore list. What impact will this have?