write in front: If this article is fortunate enough to be seen by a friend and found wrong, I hope to criticize. If you do not understand the place, we would like to discuss together.
Fundamentals of MySQL Replication
Basic issues
The MySQL logs have the following six types:
Error logs: Server startup, shutdown, error messages generated during operation, and information generated when an event (event dispatch) is run, and information generated from server processes
MySQL's master-slave replicationIn the actual enterprise application environment, the single MySQL database is insufficient to meet the future business requirements. For example, if a server fails and there is no backup server to provide the service,
The first step: getting Ready for workOperating system: Centos7.1Database: mysql-5.6.30Main host:172.17.220.145From host:172.17.220.220Step two: Set up a firewallCentos7.1 default firewall is FIREWALLD and needs to be installed via Yum
Set primary-primary replication: 1, set up a user with copy permission on both servers, 2, modify the configuration file: # on the primary server [Mysqld]server-id = 10log-bin = Mysql-binrelay-log = Relay-mysqlrelay-log-index = Relay-mysql.indexauto-
The essence of a backup is to save a copy of the dataset, but the original data is constantly changing, so the backup can only revert to the data before the data changes. What about the changes? So it's important to develop a good backup strategy.I.
Today, MySQL's master and slave databases are not synchronized.first on the master library:Mysql>show processlist; See if the next process is too much sleep. Found to be normal.Show master status; also normal.Mysql> Show master status;+--------------
Primary master replication for MySQL1, the environment of the preparation of 2 serversThe server1:192.168.0.11 system is: redhat6.4The server2:192.168.0.12 system is: redhat6.4Set primary-primary replication:1. Establish a user with copy permission
if you want to back up, make sure that MySQL opens Log-bin, with Binarylog,mysql to do full recovery when necessary, or point-in-time recovery, or location-based recovery. My data storage directory is:mysql> SHOW VARIABLES like '%datadir% '; +-------
Dual master replication:1), on the two servers to establish a user with replication permissions;2), modify the configuration file:# on master Server A[Mysqld]Server-id = 10Log-bin = Mysql-binRelay-log = Relay-mysqlAuto-increment-offset = 1 # Start
Slave_sql_running:no MySQL Sync fault resolutionCheck the database today to find that a MySQL slave is not synchronized with the host to see the slave status:Mysql> Show Slave
I. principle of Master-slave replicationMySQL master-slave synchronization process mainly relies on bin-log, mainly divided into the following three steps:1. Master changes the record to binary log (these are called binary log events, binary logs
In the process of installing, managing, and using MySQL, you need to memorize a lot of MySQL commands. And for the novice, very few commands do not know how to apply, for the veteran to have a lot of command time to forget the specific usage.
In
The Binlog log is used to record all statements that have updated the data or have potentially updated the data. Statement is saved as an "event," which describes the data changes. When we cause the database to fail for some reason, we can use the
Configure master-Slave synchronization of MySQL database (one master and one slave)
First, the main library to open Binlog, Server-id
[Root@master-mysql ~]# grep-e "Server-id|log-bin"/etc/my.cnfLog-bin =/usr/local/mysql/data/mysql-binServer-id =
first on the master library:Mysql>show processlist; See if the next process is too much sleep. Found to be normal.Show master status; also normal.Mysql> Show master status;+-------------------+----------+--------------+-------------------------------
Today, MySQL's master and slave databases are not synchronized.first on the master library:Mysql>show processlist; See if the next process is too much sleep. Found to be normal.Show master status; also normal.Mysql> Show master status;+--------------
MySQL Dual Master replication configuration test processServer environment:+-------------------+---------------------------------------------------| | server Node 1 | server Node 2 |+-------------------+------------------------+----------------------
A Brief introductionKeepalived+lvs+mysql Primary master replication is a much more frequently used MySQL high-availability scheme, in which LVS provides read load Balancing, keepalived the virtual VIP drift to achieve self-failover, while MySQL is
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.