exit and restart the MARIADB service. Log in to MySQL interactive mode, create a user account on master to implement the replication function, and authorize Replication slave,replication client permissions: MariaDB [(none)]> Grant Rep
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 the commit memory will synchronize the in-memory binary logs to disk, ensuring that the ser
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
-master-info=1 #启用之可确保无信息丢失slave-parallel-threads=2 #设定从服务器的SQL线程数; 0 means turn off multithreaded replicationBINLOG-CHECKSUM=CRC32 #启用复制有关的所有校验功能Master-verify-checksum=1 #启用复制有关的所有校验功能Slave-sql-verify-checksum=1 #启用复制有关的所有校验功能Binlog-rows-query-log_events=1 #启用之可用于在二进制日志记录事件相关的信息, can reduce the complexity of troubleshooting;Report-host=slave.mysql #slave host name, you must be able to ping thereport-port=3306 #端口# login on the slave server using the account password created on master MySQLMysql
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
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
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
|+------------------------+------------+7 Rows in Set (0.00 sec)
MARIADB [(None)]>2. Create a replication user
MARIADB [(None)]> GRANT REPLICATION SLAVE on *.* to ' user ' @ ' 192.168.0.% ' identified by ' pass ';Query OK, 0 rows Affected (0.00 sec)
MARIADB [(None)]> flu
Understanding: the built-in replication function of Mysql is the basis for building large and high-performance applications.
Understanding: the built-in replication function of Mysql is the basis for building large and high-performance applications.
Understanding:
The built-in replication function of Mysql is the basis for building large and high-performance a
to the main library to authorize an REPLICATION SLAVE account, and refresh the authorization form [[emailprotected]mysql]#mysql-uroot-h127.0.0.1-p3307-penter Password:welcometothemariadbmonitor.commandsendwith ;or\g.YourMariaDBconnectionidis8Serverversion: 10.0.15-mariadb-logsourcedistributioncopyright (c) 2000,2014,Oracle, Skysqlabandothers. type ' help; ' or ' \h ' forhelp.Type ' \c ' toclearthecurrenti
Label:http://blog.itpub.net/28218939/viewspace-1975856/Concurrent Replication ( Parallel Replication ) Series three:MySQL 5.7 and MariaDB parallel replication ContrastMa Pengfei Technology MySQL database engineer
After two mysql/mariadb on the development of binar
used.3. Modify the slave server slave:
# Vi/etc/my. cnf[Mysqld]Log-bin = mysql-bin // [not required] Enable binary logServer-id = 226 // [required] unique server ID. The default value is 1. Generally, the last segment of the IP address is used.4. Restart the mysql of the two servers.
/Etc/init. d/mysql restart5. Create an account on the master server and authorize slave:
#/Usr/local/mysql/bin/mysql-uroot-pmttangMysql> GRANT REPLICATION SLAVE ON.To 'm
Tags: CBE sha iad share process alt color Rest numberServer list:角色 ip地址主服务器 192.168.8.81从服务器 192.168.8.82To modify the configuration file for the master server:A. VIM/ETC/MY.CNF, Increase:B. Restart MARIADB:Systemctl Restart MARIADBModify the From server configuration file:A. VIM/ETC/MY.CNF, Increase:B. Restart MARIADB:Systemctl Restart MARIADBHome Server settings:A. Go to the primary server:B. View the primary server status:From the server configuration:A. Enter
Tags: star poi art Binlog get error DUP NSA engineRemember to build the MARIADB master-slave Replication environment:
System: CentOS Release 6.3
Kernel: 2.6.32-431.23.3.el6.centos.plus.x86_64
Database version:
MASTER:10.1.16-MARIADB MariaDB Server
SLAVE:10.1.34-
A copy overview MariaDB Built-in replication capabilities are the foundation for building large, high-performance applications. mariadb mariadb Slaves 650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/88/60/wKioL1f0tROzIpxFAAB6DnoTB1A683.png "title=" t[ fgoi5r@) ya9c4$i~~5} ' 8.png "alt=" Wkiol1f0tr
Configure MySQL Database master-slave replication is for data to be more secure, better performance, can achieve fast failover and so on
Here are two dual-core 4GB memory of the Ubuntu 14.04+mariadb-10.0.13 master and slave copy. Let's take a look at the my.cnf configuration file where we compiled the installed MARIADB database:
The result
Tags: MariaDB primary master Synchronous replicationmariadb Main Master synchronization, that is, two mariadb between the main from, each mariadb are dominated, from the dual role. 1. MARIADB01 ConfigurationVi/etc/my.cnf.d/server.cnf[Mysqld]Server-id = 1Log-bin = Master-logRelay-log = Slave-logAuto_increment_offset = 1Auto_increment_increment = 22. MARIADB02 Conf
:248Until_condition:noneUntil_log_file:until_log_pos:0Master_ssl_allowed:noMaster_ssl_ca_file:Master_ssl_ca_path:Master_ssl_cert:Master_ssl_cipher:Master_ssl_key:Seconds_behind_master:nullMaster_ssl_verify_server_cert:nolast_io_errno:0Last_io_error:last_sql_errno:0Last_sql_error:Replicate_ignore_server_ids:Master_server_id:2MASTER_SSL_CRL:Master_ssl_crlpath:Using_gtid:current_posgtid_io_pos:0-2-6451 row in Set (0.00 sec)MariaDB [(None)]> show variable
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.