MariaDB master-slave Replication

Source: Internet
Author: User

MariaDB master-slave Replication

MySQL Replication: NySQL Replication. MySQL Replication adopts asynchronous working mode by default.

The replication function of mysql is built in mysql. After it is installed, mysql replication is a basic tool for mysql to implement large-scale high-performance applications, it is the basic architecture for mysql to scale horizontally. To cope with more access requests, we usually need to scale the server. There are two ways to scale the server: scale up and scale out;

Upward Scaling: scale on, also known as vertical scaling, is generally used to expand the memory or number of CPUs of servers.

Outward Scaling: scale-out, also known as horizontal scaling, means that one server is not enough, and another server is not enough. In this case, it is outward scaling.

In fact, MySQL's replication function is to use MySQL's outward expansion capability, that is, the horizontal expansion function.

Synchronous replication: the master server first writes a piece of data to the disk file and writes it to the binary log file, the slave server sends the request binary information to the master server and stores it in the relay log. After the binary information is saved, the local SQL thread applies the relay log to a local disk file on the slave server, after this process is completed, the slave server returns the confirmation result to the master server, and the master server returns the result to the client.

Asynchronous replication: when the master server needs to write data, it first writes the data to a local disk and binary file logs. After the binary log file is written, the result is returned to the client, it doesn't matter whether the slave server synchronizes binary logs to the master server or not.

Note: The MySQL databases of both parties must be consistent during replication. If they are inconsistent, the master database must be lower than the slave database.

Working principle of MySQL Master/Slave service:

Note that if the data is constantly requested from the server to the master server and the data is found to be the latest, the I/O thread of the slave server will change to sleep, because the master server will notify and the I/O thread will not perform Round Robin, the slave server's binary log files are usually disabled, and the slave server cannot perform write operations.

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.