2560 June 1 0 18:01 Xtrabackup_logfile 7. Create a sync user for the main librarymysql> GRANT replication Slave on * * to ' slave25 ' @ '% ' identified by ' Oracle ';Query OK, 0 rows affected (0.05 sec) 8. Recovering the Master library data from the library--Rename the original DataDir folder to a new location from the library and create the original folder[Email protected] ~]# Mv/data/mysql/data/mysqlbak
, fast destruction capability.
This is exactly the strength of Docker.
The following is how long it takes to start an instance using docker, less than 1 s. If you use a script, it will never be so fast.
# time docker run --name slave -v /etc/slave.cnf:/etc/mysql/my.cnf -v /var/lib/mysql/slave:/var/lib/mysql -p3307:33
MySQL 5.6.x semi-sync replication Configuration
EnvironmentMaster Database: CentOS6.5 x64 192.168.0.65 mysql-5.6.29Slave Database: CentOS6.5 x64 192.168.0.66 mysql-5.6.29
Connection: MySQL 5.6 master-slave synchronization configuration case
The concept of semi-synchronous re
simple,MySQL 5.6 References Gtid,multi-thread replication (multithreaded replication)Basic steps for configuring MySQL replicationMaster-slave replicationI. MasterEnable binary loggingLog-bin=master-binLog-bi-index =master-bin.index
Choose a unique Server-idServer-id ={0-2^32}
To create a u
MySQL replication on Ubuntu12.04
I. Introduction
MySQL Replication is based on the binnary logging mechanism to synchronize data between the master and slave. Both mechanism, configuration, and operation and maintenance are much simpler and more stable than MSSQL2000 replication
threads: where the Binlog dump thread runs on the main library, and the IO thread and SQL thread run from the library. When starting replication from the library (start slave), first create the IO thread connection main Library, the main library then create the Binlog dump thread to read the event sent to the IO thread, the IO thread gets to the event after the update to the log from the library trunk logs
configuration cannot be lower than the master node;
If you are sensitive to latency issues, consider using the MARIADB branch version, or go directly to the latest MySQL 5.7 version. The use of multi-threaded replication can greatly reduce replication latency, and another alternative for which
is particularly sensitive to
replication in the slave database based on the bin log file name and position obtained in the previous step.
-- Execute in the slave database (change the value mysql-bin.0000099 and 0 in the Command master_log_file = 'mysql-bin.0000099 ', master_log_pos = 5 to the value obtained in the previous step)
Change master to master_host = '192. 111.111.110 ',
Master_use
is written to the binary log, master notifies the storage engine to commit the transaction.The next step is to slave copy the Binary log of Master to its own trunk logs. First, slave starts a worker thread ――i/o thread. The I/O thread opens a normal connection on master and then starts Binlog dump process. Binlog dump process reads the event from the binary log of master, and if it has been followed by master, it sleeps and waits for master to produce a new event. The I/O thread writes these ev
process. The SQL thread reads events from the log and replays the events in them to update the slave data so that it is consistent with the data in master. As long as the thread is consistent with the I/O thread, the trunk log is typically located in the OS cache, so the overhead of the trunk log is minimal.In addition, there is a worker thread in master: As with other MySQL connections, slave opening a connection in master will also cause master to
[$#-ne 1]; Thenecho "Usage: $ Exit-1FiNo=$1Sub=mysql$noBase=/usr/local/mysqlspidfile= $base/run/$sub. pidif [!-F "$pidfile"]; Thenecho "' $pidfile ' not exist, MySQL server could not start"Exit-2FiPid= ' Cat $pidfile 'Kill $pidExecution: stop_mysql.sh 1 to stop the MYSQL1, after the parameter changed to 2 can stop MYSQL2, as follows:2. Configure the primary data
pipes.# Note that using this option without enabling named pipes on Windows# (Via the "enable-named-pipe" option) will render mysqld useless!## Skip-networking# Replication Master Server (default)# Binary logging is required for replicationLog-bin = mysql-binLog-slave-updates# Required unique id between 1 and 2 ^ 32-1# Defaults to 1 if master-host is not set# But will not function as a master if omittedSer
How to install MySQL database, do not say here, just say its master-slave copy, the steps are as follows:1, the master-slave server for the following actions:1.1. Consistent version1.2. Initialize the table and start MySQL in the background1.3, change the root password2. Modify master server Master:#vi/etc/my.cnf[Mysqld]Log-bin=
master slaveMysql software can be downloaded in the http://www.mysql.com [/, source code or rpm package can be, because RHEL6 comesMysql software package, directly install yum.# Yum install mysql-server-yMaster server Configuration1) configure the/etc/my. cnf configuration fileAdd parameters under [mysqld]Log-bin = mysql-bin # Start the binary log systemBinlog-d
replication is that one slave server can be used for backup without interfering with the master server. During the backup process, the master server can continue to process updates.
MySQL uses three threads to execute the replication function (one of them is on the master server and the other two are on the slave server. When
Go to the mysql homepage and cover all the articles about how good mysql 5.6 is. Later, I browsed the 5.6 update description, saying that replication was enhanced, and some people tested to enable replication, which had little impact on performance. Unlike before, the impact on performance was obvious. But better perfo
. UNLOCK the unlock tables of the master server database. If you stop apache or nginx, enable them at www.2cto.com 6. copy the backup files on the master node to the slave server. You do not need to use WinScp to download the files to the local computer and then upload them to the slave server. You can directly use the scp command to copy the backup files between servers, which is faster. Scp-r root@XXX.XXX.XXX.XXX:/root/bak. SQL./7. before deleting old data on the slave server, make sure that a
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.