1

Hi I have a master Mysql server from where i am replicating other 2 slaves. The issue is one of the slave stops with an error frequently. The error message is below.

Error 'Duplicate entry '1993996' for key 1' on query. Default database: 'ooxadmin_ooxmonitor'.
Query: 'INSERT INTO users_history SET
user_id = '22',
user_last_access = NOW(),
user_status = 'Online',
user_session = 'aa78ee40a941aea26a0e0c10c714b5a9',
user_ip = '94.200.71.50''

I have tried 'SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1' and starting the slave again, then it starts replicating and then stops after a few minutes/hours. I want to know what causes this issue and how to setup replication without this error. My mysql version is 5.0.9.

2
  • 1
    I see you're replicating a radius db, what is the key field that's set.. maybe you could post a show create table ? Commented May 23, 2013 at 9:16
  • what error you are getting in Mysql Logs? Please post some here. Commented May 23, 2013 at 10:14

1 Answer 1

1

If you skip the error that means it will continue replicating, but the reason why it broke is not solved. Install percona-toolkit, run pt-table-checksum to find the differences, and run pt-table-sync to resync the tables. But I guess the most easy way to solve this to discard a slave, and restore it from a recent backup of master, and set replication from there.

Look here to read more about checksumming: http://blog.balazspocze.me/2014/12/03/a-few-words-about-database-checksumming/

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.