Tags: server database userMySQL Database supports the replication of one-way, two-way, chained cascade, ring-like, and different business scenarios. During the replication process, one server acts as the primary server, receives content updates from the user, and one or more other servers act as slave servers, receive log content from the primary server binlog files, parse out SQL, and re-update to the slav
Function
Permission
Monitor user
MMM (Multi-Master replication manager of MYSQL) monitors the health status of each Master
REPLICATION CLIENT
Agent user
MMM proxy is used to set read-only attributes, rep
Server multi-MySQL service setup and master-slave replication One, One_server multi-mysql service building "1" The first MySQL service build No introduction here, we think the first MySQL service has been completed; "2" copy of MySQL Basedir directory # cp/usr/local/mysql//usr/local/mysql_s //If the original MySQL ba
case, the value of the seconds_behind_master can really represent the number of seconds that slave is behind master. In the case of poor network, I/O thread synchronization is slow, slave received binary log information, SQL thread can be quickly executed. At this time Seconds_behind_master is 0, in this case slave behind master a lot.
In order to eliminate the interference of the network, we can refer to
set the isolation level to read-commited you must set the binary log format to row, and now MySQL officials think statement this is no longer suitable for continued use; But mixed type is under the default transaction isolation level. may result in inconsistent master-slave data;Log-slave-updates, Gtid-mode, Enforce-gtid-consistency, Report-port and Report-host: For the start of the Gtid and to meet other ancillary requirements;
permissions to the slave server account on the primary serverGrant replication client,replication Slave on * * to [e-mail protected] ' 192.168.1.% ' identified by ' xushouweidb ';Flush privileges;7 is shown below: Specify the primary server to replicate from the server through the statement (note that can be a master multi
Master-Slave formMySQL master-slave replication flexibility
One Master one from
Primary master replication
One master multiple reads from the---extended system, because reads ar
statement,row,mixed3, where mixed refers to the first two hybrid row: Generally, it's better to have a row with row Statement: When a statement is made for each row of the database, many rows that are reflected on the disk have changed, which is appropriate for the statement format A mixed format supported by the Mixed:2 form Restart MySQLShow Master status;//See if Master is already acting as the
This article mainly Introduces Multi-source replication in MySQL. the multi-source replication function has been added to MySQL since MySQL 5.7.2, for more information, see the latest version of Mysql5.7.2. Most of the improvements are in terms of database performance and replicati
. MySQL defaults to statement-based replication with high efficiency. Row-based replication: Copy the changed content past, rather than executing the command from the server again.Mixed-type replication: statement-based replication is used by default, and row-based replication
= ' Copy ', Master_password= ' 123456 ', master_port=3307, Master_log_file= ' mysql-bin.000001 ', master_log_pos=154; Set from server 3307, 3310, their master is 3308, that is, on 3307 and 3310 do the following: Change Master to master_host= ' 192.168.91.135 ', master_user= ' Copy ', Master_password= ' 123456 ', master_port=3308, Master_log_file= ' mysql-bin.000001 ', master_log_pos=154; 7. Execute on fou
library B he now has what goods in the warehouse, the next time from the Library B to find his new goods just take out this list A to know if his goods are the same as their own, If the same will not be sent, if not the same, according to the list of goods cut-off location of the latest, the new goods here can be understood as Binlog file content, the list is Binlog location information post;Every time you get a new item from the library, you'll be happy. Start your own SQL thread to resolve th
MySQL replication can ensure the redundancy of the data and read and write separation to share the system pressure, if the primary master replication can also be good to avoid the primary node single point of failure. But there are some problems with MySQL master replication
event of a failure of the main library.Semi-synchronousThere should be at least one slave to turn on the function of the semi-synchronous copy on master.At this point, a thread commits a transaction on master that will be blocked until it learns that a slave that has been turned on for semi-synchronous replication has received all events for this transaction or waits for a timeout.MySQL Semi-synchronous re
MySQL replication can ensure the redundancy of the data and read and write separation to share the system pressure, if the primary master replication can also be good to avoid the primary node single point of failure. But there are some problems with MySQL master replication
1, the principle of master-slave replication:*master, record data change operations- Enable Binlog logging mode- allow Slave to read binlog logs*slave running 2 simultaneous threads-Slave_io: Responsible for connecting Master, copy its binlog log file to the Relay-log file of the machine-Slave_sql: Executes the SQL sta
transaction to see the update in the transaction, the query outside the transaction cannot see"
does not guarantee atomicity: Redis in the same transaction, if a command fails after exec, the subsequent command is still executed and no rollback is performed.
two. master-slave copying
Common one main two from
redis> info replication To see if the current Redis is the main or the library
matching from librar
Memcached memory replication/Master/Slave Mode-mecached1.4.13
Repcached Introduction
Repchched Project address: http://repcached.sourceforge.net/
Repcached
"Repcached" is a patch set that adds the data replication feature to memcached 1.2.x.
Main PurposeImplement the redundant memcached System
Main functions
Multi-
configuration file, remove the Read-onlyauto_increment_increment=2
auto_increment_offset=2
log-slave-updates=true
log-bin=mysql-bin3. Restart the databaseServer mysqld Restart4, the original main library as from the library, do the same configuration, I use a multi-instance, so only changed the portChange MASTER to
master_host= ' 11.2.0.75 ',
master_port=3307
master_user= ' rep ',
master_password= '456 ',
I,Principle
RedisThe master-slave replication function is very powerful.MasterYou can have multipleSlaveAndSlaveYou can have multipleSlaveIn this way, a powerful multi-level server cluster architecture is formed. The following is aboutRedisSome features of master-slave replicatio
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.