Tags: mysql mariadb master-slave replicationI. Introduction of the PrincipleIn order to ensure data consistency, the current mainstream database adopts a data storage engine that supports transaction types, such as InnoDB, and so on, when a transaction is committed, it is written to the transaction log, the data is modified, and the statements that have any effect on the data are recorded in the binary log.
MySQL Dual master Interoperability is the two MySQL server is the primary server, but also the other side of the slave server, so as to share a part of the master server write requests, because if it is a single master model, the data write can only be written to a MySQL server, while the dual master model can be writt
Tags: User event server binary images sel use server code1. First build the master-slave Main environment: 192.168.1.117 From the environment: 192.168.1.123 A. First install the mariadb in the form of a binary package (negligible) B. Configuring variables for the environment Pass Match [Mysqld] Binlog-format=row Log-slave-updates=true Master-info-repository=table
Mariadb in fact, like MySQL, there is nothing different that is the name is not the same ~.~! Start ~ Previous experiment is a MARIADB single-machine multi-instance installation Dual instance Port 3307 Main Library, 3308 from library 3307 mysqld configuration of the primary instance [Mysqld2]port=3307socket=/tmp/mysql3307.sockpid-file=/tmp/mysql3307.pidmax_allowe
The previous article thanks to "Mysql, MariaDB traditional master-slave cluster Configuration", the technology has been very mature. Starting from Mysql5.6 and MariaDB10.0, with the new master-slave scheme Gtid, but the two systems to this version of the branch, the implementation has been different, configuration methods are different, the following are describe
status; View the synchronization status, where the seconds_behind_master can see if the master node is behind and how much is behindView whether the From node is read only show global variables like ' read_only ';Log_slave_updates = 1 (the event that allows the repository to replay it is also logged to its own binary log, so that it is both a slave node and a master node)Sync_binlog =1 MySQL each time in t
rows Affected (0.00 sec) mysql> INSERT INTO HI_TB values (001, ' Bobu ');Query OK, 1 row Affected (0.00 sec) mysql> show databases;+ —————— –+| Database |+ —————— –+| Information_schema || hi_db || MySQL || Test |+ —————— –+4 rows in Set (0.00 sec) MySQL Query from server: mysql> show databases; + —————— –+| Database |+ —————— –+| Information_schema || hi_db | I ' M here, you see?| MySQL || Test | + —————— –+4 rows in Set (0.00 sec) Mysql> Use hi_dbDatabase changedMysql> select * from HI_TB; Vi
master node.
When viewing the position (location) of the current binary log, you need to stop any database submission. You can use this coordinate point to tell the slave server to Start copying from a specific point.
Execute the command "flush tables with read lock" on the master to force log writing and LOCK all TABLES. During this period, the session cannot be closed and the LOCK will be released once t
the server to the primary server to request binary information stored in the trunk log, after saving by the local SQL thread from the log application to the local disk file from the server. When this process is completed and returned from the server to confirm the results to the primary server, the primary server will return the results to the client. so-called asynchronous replication:when the primary server to write data, write to the local disk, write to the binary file log, write the binary
Tags: mariadb mariadb Master1./etc/my.cnf on the master nodeService-id=1Permissions of the MySQL authorized backup user in the main libraryGrant Replication Slave on * * to [e-mail protected] '% ' identified by ' password ';Export the whole library at the terminal to ensure database offset consistency join--master-data
Environment
Master1/master2
System
Ip
Database version
Master1
CentOS6.7
10.10.3.211
mariadb-10.1.19
Master2
CentOS6.7
10.10.3.212
mariadb-10.1.19
First, the configuration of Master1(1) Modify the Master1 configuration file/etc/my.cnf, as follows:Log-Bin= /Usr/Local/Mysqllogs/Binlogs/Master1-bin #启用二进制日志rel
/data3306Total 110632。。。。。。。。drwx------2 MySQL mysql 4096 may 01:16 database_3306。。。。。。。。[Email protected] ~]# ll/mariadb/data3307Total 110632。。。。。。drwx------2 MySQL mysql 4096 may 01:16 database_3307。。。。。。[Email protected] ~]# ll/mariadb/data3308Total 110632。。。。。。drwx------2 MySQL mysql 4096 may 01:16 database_3308。。。。。。################################################# # # Close Instance # # ##############
log file, from the server to the primary server to request binary information stored in the trunk log, after saving by the local SQL thread from the log application to the local disk file from the server. When this process is completed and returned from the server to confirm the results to the primary server, the primary server will return the results to the client. so-called asynchronous replication:when the primary server to write data, write to the local disk, write to the binary file log, w
Recently do slow SQL optimization, compare headaches, see slow SQL is full of some select count (*) or sum of aggregate statistics such as SQL, because my database is the traditional master-slave, or a master more from, such slow SQL directly in the database statistics, there is a certain impact on the line, And because of multiple DB master-slave, statistics som
MARIADB Multi-instance: Environment and ideas:
centos7.4
Yum installation implementation.
One version of MySQL is implemented via multiple ports
Plan ports for 3 instances: 3306/3307/3308.
Separate the respective configuration files, log files, PID, sockets.
Install MARIADB:[[emailprotected] ~]#yum install
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.