MariaDB master-slave Replication
MySQL Replication: NySQL Replication. MySQL Replication adopts asynchronous working mode by default.
The replication function of mysql is built in mysql
Translated by: Iron anchor (Translated by: July 22, December 25, 2013): SettingUpReplication master-slave Replication involves two steps: setting on the master server (group) and setting on the slave server (Group). if the master server master is not enabled, activate the bi
Tags: One move sleep Modify type Date res access OSIMARIADB Primary master replication +keepalived high AvailabilityHost 1:192.168.1.22Host 2:192.168.1.23vip1:192.168.1.233vip2:192.168.1.234Host 1 settings:Install the RPM package that needs to be usedYum-y Install Ipvsadm keepalived mariadb mariadb-serverStart
Tags: mysql mariadb master-slave replicationI. Introduction of the PrincipleIn order to ensure data consistency, the current mainstream database adopts a data storage engine that supports transaction types, such as InnoDB, and so on, when a transaction is committed, it is written to the transaction log, the data is modified, and the statements that have any effect on the data are recorded in the binary log.
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 t
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
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)]> Gr
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
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
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
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
= 2Auto-Increment-Increment= 2Server-Id= 2Restarting the database service(2) Create a user with copy permission, the command is as followsCREATE USER 'Jerry'@'10.10.3.211'Identified by '123456';REVOKE All Privileges,GRANT OPTION from 'Jerry'@'10.10.3.211';GRANTReload,lock TABLES,REPLICATIONCLIENT,REPLICATIONSLAVE on *.* to 'Jerry'@'10.10.3.211'; FLUSHPrivileges;Iii. viewing the status of Master1 and Master2SHOW MASTER STATUS;Master1Master2Four, poi
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 s
=3307,; queryok,0rowsaffected (0.22sec) #好了现在连接上了 master_log_file= ' master3307-bin.000005 ',master_log_pos=632 Indicates that the binary log file from the primary server starts copying because this is the replication authorization information, so there is no need to copy, on the primary server can view showmasterstatus; view content Showbinglog eventsin ' master-bin.000001 ';
Yes state, otherwise it is an error state (e.g., one of the No is an error).650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/88/64/wKiom1f0tT-TSAtNAADQRK_zq6o089.png "title=" b7ive[ J~v081523xiymea4j.png "alt=" wkiom1f0tt-tsatnaadqrk_zq6o089.png "/> Above operation process, master and slave server configuration is complete.9, the master-slave server test:( This is the primary server)650) this.wid
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
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 =
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.