MySQL master-slave replication case
Working principle diagram:
Principle of master-slave replication:It can be divided into synchronous replication and asynchronous replication. In the actual replication architecture, most of them are asynchronous
|
binlog_ignore_db | +------------------+----------+--------------+------------------+
| Mysql-bin.000005|343| |
| +------------------+----------+--------------+------------------+1RowinchSet (0.00Sec 2. Configuring the Slave server (Slave) [Email protected] shell]#VI/etc/MY.CNF Server-ID= - //Modify the ID here as long as it is larger than master
Relay-log=relay-log-bin//In
Troubleshooting of mysql semi-synchronous replication and mysql Synchronization
1. BackgroundBy default, online mysql replication is asynchronous. In extreme cases, when switching between the master and slave databases, there is a certain probability that the slave database
AB replication (mysql synchronization) bitsCN.com
Project Environment:All systems are cent OS 5.5Master server IP address: 192.168.19.172 (master)Slave server IP: 192.168.19.168 (slave)Both of them have set up mysql (the root user and password are empty)1: Set synchronization master and modify the mysql master configu
process is slow, it is reasonable to use mysqldump to export the data on the master server, import the data to the slave server, and then start synchronization.
4. Preparation:Create a test table on the master serverMysql> create database data;Query OK, 1 row affected (0.03 sec)Mysql> select * from data.info;+ ----- + ------- + ----- +| Sid | name | age |+ ----- + ------- + ----- +| 1 | zhang | 23 || 2 | l
| ZXM || 2 | King |+------+------+4 rows in Set (0.00 sec)Iv. SummaryEncounter problems1, the installation process error, unable to install mysql-server-advanced-5.6.19-1.el6.x86_64.rpm, the reason is that Redhat comes with the installation of mysql-libs-5.1.66-2.el6_3.x86_64, some files already exist, causing the installation to fail.Workaround: Remove mysql-li
Label:1 Replication OverviewMySQL's built-in replication capabilities are the foundation for building large, high-performance applications. The distribution of MySQL data across multiple systems is done by copying data from one of the MySQL hosts to the other host (slaves) and re-executing it again. One server acts as
1045 (28000) is displayed: Access denied for user ' test ' @ ' 192.168.1.204 ' (using Password:yes) jumps to 3rd 2. Log on to the master server for MySQL, view all users MySQL > select user,host from Mysql.user; Is my source of error, you can see the user name is completely wrong, first delete the wrong user: mysql >
The following articles mainly discuss the actual operation steps for optimizing the MySQL built-in replication function, including the configuration of the master server and the actual operation process for configuring the slave server, and create a master-slave relationship and other related content, the following is the main content description. MySQL internal
Mysql replication function-"master-slave" structure bitsCN.com
Mysql replication function-"master-slave" structure
1. configure the master server
1. add content in my. ini
2. create an account with "copy permission"
Create an account
Grant all operation permissions on the database to be copied to the created accou
applications Master has more than one library, each library transaction can be parallel, because the lock on a library, B library is not affected, but reflected in the binary log must have sequential order So there is no way to avoid slave lag, so after MySQL 5.5 introduced multithreading mechanism. supports one from multiple and multi-threaded replication Multi-threaded
important limitation-replication is serialized on slave, meaning that parallel update operations on Master cannot operate concurrently on slave.MARIADB Master-slave replicationMaster:sql-master 192.168.200.101/24Slave:sql-slave 192.168.200.102/24,192.168.200.103/241) Install the MariaDB software package separately on the primary and from the MariaDB server . Yum install-y mariadb mariadb-devel mariadb-serverSystemctl Restart MARIADBSystemctl Enable M
Limodou in Soundbreak we play live audio and video 24 hours a day, so we cannot make a convincing test of the new replication feature of MySQL. Through the test, we found that we can use this feature to maintain data synchronization with the backup database server. in this way, when the master server is a source author
(name) VALUES ("Andy"), ("Taoye");Query OK, 1 row Affected (0.00 sec)Mysql> select * from Mm_repl;+----+-------+| ID | name |+----+-------+| 1 | Andy || 11 | Taoye |+----+-------+2 rows in Set (0.00 sec)--New Main library test data synchronization statusMysql> select * from Mm_repl;+----+-------+| ID | name |+----+-------+| 1 | Andy || 11 | Taoye |+----+-------+2 rows in Set (0.00 sec)
/local/MySQL/
Shell> tar-cvf/tmp/MySQL-snapshot.tar./data
If the user account on the slave server is different from the master server, you may not want to copy the MySQL database. In this case, the database should be excluded from the archive. You do not need to include any log files, master.info or relay-log.info files in the archive.
When the flush tables with
How to Use docker to quickly build a MySQL master-slave replication environment, dockermysql
When learning MySQL, we often test the functions of various parameters. At this time, you need to quickly build a MySQL instance, or even Master/Slave.
Consider the following scenar
Problem about master/slave replication delay in mysql bitsCN.com
When I interviewed mysqldba about the master-slave replication delay in mysql, I encountered a question: describes the implementation principle of the msyql replication mechanism and how to keep dropping the
] #mysqldump-uroot-p--all-databases >/data/all.sql6. Ensure that data is exported without data insertion, and then view the main library statusShow master status;7. After exporting the data, unlock the main library and resume the writable;Unlock tables;8. SCP the backed-up exported data to the slave databasescp/data/all.sql [Email protected]:/data/Slave configuration from Library1. Set the server-ID value and close the Binlog function parameter database server-id is unique within the master-slav
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.