Replication from 5.5.36 to 10.1.10

Asked by alyssenko on 2016-01-23

I am trying to enable replication from an older version of MariaDB on the master (5.5.36) to a newer version on the slave (10.1.10). Since the master doesn't support GTID I'm trying to turn it off....

After successfully preparing the backup (using Percona xtrabackup) I attempt to start replication:

CHANGE MASTER TO
MASTER_HOST='x.x.x.x',
MASTER_USER='replicate',
MASTER_PASSWORD='xxxx',
MASTER_PORT=3306,
MASTER_LOG_FILE='mysql-bin.005214',
MASTER_LOG_POS=890018419,
MASTER_CONNECT_RETRY=10,
MASTER_USE_GTID=no;

This is what I'm seeing in the mysql error log:

[ERROR] Slave I/O: Unable to load replication GTID slave state from mysql.gtid_slave_pos: Table 'mysql.gtid_slave_pos' doesn't exist, Internal MariaDB error code: 1146
[Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.005214' at position 890018419, relay log './mysql-relay-bin.000001' position: 4
[ERROR] Slave SQL: Unable to load replication GTID slave state from mysql.gtid_slave_pos: Table 'mysql.gtid_slave_pos' doesn't exist, Internal MariaDB error code: 1146
[Note] Slave I/O thread: connected to master 'replicate@x.x.x.x:3306',replication started in log 'mysql-bin.005214' at position 890018419
[ERROR] Slave SQL: Error 'Duplicate entry '46082' for key 'PRIMARY'' on query. Default database: 'etl_execution'. Query: 'INSERT INTO `batches` (`batch_file`, `completed_at`, `created_at`, `status`) VALUES ('/home/x/x.ebf', NULL, '2016-01-20 09:14:03', 'executing')', Internal MariaDB error code: 1062
[Warning] Slave: Duplicate entry '46082' for key 'PRIMARY' Error_code: 1062
[ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'mysql-bin.005214' position 890018495

I feel like I'm close to getting the replication up and running but not sure what to do now- any help would be much appreciated- thanks guys.

Question information

Language:
English Edit question
Status:
Answered
For:
MariaDB Edit question
Assignee:
No assignee Edit question
Last query:
2016-01-23
Last reply:
2016-01-24
Sergei Golubchik (sergii) said : #1

The important part is:

 [ERROR] Slave SQL: Error 'Duplicate entry '46082' for key 'PRIMARY'' on query. Default database: 'etl_execution'. Query: 'INSERT INTO `batches` (`batch_file`, `completed_at`, `created_at`, `status`) VALUES ('/home/x/x.ebf', NULL, '2016-01-20 09:14:03', 'executing')', Internal MariaDB error code: 1062

It seems that your slave is out of sync, this INSERT statement has succeeded on the master, but caused the duplicate key error on the slave. Perhaps you started replication from earlier point in time than when you made the backup?

Can you help with this problem?

Provide an answer of your own, or ask alyssenko for more information if necessary.

To post a message you must log in.