How to configure MariaDB replication in CentOS Linux

Source: Internet
Author: User

How to configure MariaDB replication in CentOS Linux

This is a process of creating duplicate database versions. The replication process not only copies a database, but also synchronizes changes from the master node to a slave node. But this does not mean that the slave database is the same as the master database, because replication can be configured to copy only the table structure, rows, or columns, which is called local replication. Replication ensures that specific configuration objects are consistent across different databases.

Mariadb replication Concept

Backup: copy can be used for database backup. For example, when you perform master-> slave replication. If data on the master node is lost (such as hard disk damage), you can recover your database from the node.

Extension: You can use master-> slave replication as an extension solution. For example, if you have large databases and SQL queries, you can use replication to separate these queries from each replication node. The write operation SQL should be performed only on the master node, while the read-only query can be performed on the slave node.

Distribution solution: You can use replication for distribution. For example, you can distribute different sales data to different databases.

Fault solution: assume that you have created a replication structure with the master node> slave Node 1> slave Node 2> slave Node 3. You can write script monitoring for the master node. If the master node fails, the script can quickly switch from node 1 to the new master node, in this way, the replication structure is changed to the master node-> slave Node 1-> slave Node 2. Your application can continue to work without stopping services.

Simple illustration of Replication

Before you start, you should know what binary log files and Ibdata1 are.

The binary log file contains records of all changes to the database, data, and structure, and how long each statement has been executed. Binary log files include a series of log files and an index file. This means that the main SQL statements, such as CREATE, ALTER, INSERT, UPDATE, and DELETE, will be placed in this log file, and the statements such as SELECT will not be recorded, they can be recorded to common queries. log File.

In simple terms, Ibdata1 is a file that includes all tables and all database information.

-------------------------------------- Split line --------------------------------------

Install LAMP (Apache with MariaDB and PHP) in CentOS/RHEL/Scientific Linux 6)

Implementation of MariaDB Proxy read/write splitting

How to compile and install the MariaDB database in Linux

Install MariaDB database using yum in CentOS

Install MariaDB and MySQL

How to migrate MySQL 5.5 database to MariaDB 10 on Ubuntu

Install MariaDB on the Ubuntu 14.04 (Trusty) Server

  • 1
  • 2
  • Next Page

Related Article

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.