MARIADB Master-Slave replication configuration method in Azure cloud server

Source: Internet
Author: User
Configure MySQL Database master-slave replication is for data to be more secure, better performance, can achieve fast failover and so on
Here are two dual-core 4GB memory of the Ubuntu 14.04+mariadb-10.0.13 master and slave copy. Let's take a look at the my.cnf configuration file where we compiled the installed MARIADB database:
The result of the above means that the MySQL server will first find my.cnf in the directory/etc, followed by the/etc/mysql/directory to find, and so on ... Since I compiled the MY.CNF configuration file was specified under the:/app/mysql/etc directory. All we first link the configuration file to the directory/etc below:
Ln-s/app/mysql/etc/my.cnf/etc/my.cnf
The configuration of the primary mariadb is as follows:
Note The default Log-bin binary log and configure a new binary log file path to create a new binary log storage directory:
Mkdir/app/mysql/logs && chown mysql.mysql-r/app/mysql/logs
New MARIADB database user with replication permissions:
GRANT REPLICATION SLAVE on *.* to ' backup ' @ ' 42.159.228.231 ' identified by ' Mariadbbak. '
To this end, the main mariadb configuration is completed, restart the MySQL server. For more details, see the status of master database server.
From the MARIADB server configuration:
Note that Server-id must be not 1, must be greater than 1 of the other number, here is set 12.read-only = on means: Open the relay log, relay_log refers to the log path;
The above configuration file is the default except for the annotation of #log-bin=mysql-bin. So, the configuration is very simple. Below to verify the next.
MARIADB master server:
Start MARIADB from server:
Start slave server:
Start slave;
show slave status;
Create a database on the primary server to verify that it is synchronized to the server:
To this end, the MARIADB master-slave replication on the Azure cloud is configured. Haven't posted many pictures in a long time.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.