Question regarding Multi-source MariaDB replication

Comments

1 comment

  • Avatar
    Ashraf Sharif

    Hi,

    Following example shows on how to add new database/master connection to existing multi-source replication:

    1. To change the GTID positioning, you have to stop all slaves:

    MariaDB> STOP ALL SLAVES;

    2. Retrieve the latest Gtid_Slave_Pos. This value will remain the same on all slaves' channel:

    MariaDB> SHOW ALL SLAVES STATUS\G
    ..
    Gtid_Slave_Pos="1-101-190569,2-102-156664";
    ..

    3. Set the new global_slave_pos by appending the gtid_slave_pos for domain ID 3 (the new database on new master):

    MariaDB> SET GLOBAL gtid_slave_pos="1-101-190569,2-102-156664,3-103-15074";

    4. Configure a new master connection for domain ID 3:

    MariaDB> SET @@default_master_connection='mariadb3';
    MariaDB> CHANGE MASTER 'mariadb3' TO MASTER_HOST='10.0.0.103', MASTER_PORT=3306, MASTER_USER='<slave user>', MASTER_PASSWORD='<slave password>', MASTER_USE_GTID=slave_pos;

    5. Start all slaves:

    MariaDB> START ALL SLAVES;

    That's all. 

    Regards,

    Ashraf

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk