How to Setup MariaDB (Master-Slave) Replication in CentOS/RHEL 7 and Debian 8

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gabriel Cánepa

Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

13 Responses

  1. ilyass says:

    Thank you for this post; If only you can change server_id to server-id.

  2. Jette says:

    Very nice post! I have one question. Why do you run mysql_upgrade? The documentation states that this command should be run after upgrading mariadb. So I am wondering why you use it when setting up replication on a fresh installation?

  3. Daniel says:

    Hi Gabriel,

    Great post!!! I have a noob question:

    How can i recover my master from my slave? For example in a disaster recovery where i lost my master DB, only i have to do a dump in the slave and recover the db in master?

  4. Prem says:

    Hello, after configuring slave server unable to start MySQL service.

    • Gabriel A. Cánepa says:

      I’m sorry, but I’m afraid we can’t help you if you don’t provide more details. Error message?

  5. Aviram says:

    I have gone through so many guides, but this one is by far the best. Clear, concise and accurate.

    I will be implementing Zabbix/MariaDB in my production environment soon, planning on using pacemaker for Zabbix HA and master-slave replication for MariaDB. This will help immensely. Thank you so much!

  6. Tim says:

    Beautiful instructions. Worked like a charm on Ubuntu 14.04. Very simple and to the point. This is a rare commodity in Linux ‘How-To’s’
    Thank you VERY much!

  7. Yusuf Eka says:

    i have error when i start slave. the error is no query specified, what should i do?

  8. krx says:

    i have problem with replication. When i add bind-address MY_IP _ADDRESS then my web apps on mysql not work… but when bind-address is, then apps work but not work replication….

  9. Jagan says:

    This post is very helpful!
    Can you please make a post on how to take full and incremental backup on Maria DB?

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.