In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
1. Install mysql5.6rpm-Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpmyum install mysql-community-server- yrpm-qa | grep mysqlmysql-community-libs-5.6.40-2.el7.x86_64mysql-community-server-5.6.40-2.el7.x86_64mysql-community-release-el7-5.noarchmysql-community-client-5.6.40-2.el7.x86_64mysql-community-common-5.6.40-2. El7.x86_64# successfully installed systemctl start mysqldsystemctl enable mysqldmysql_secure_installation # to do some security configuration Select 2 according to the option. Add my.cnf configuration parameter in master-slave synchronous configuration # add log-bin = mysql-binserver-id = "slave library log-bin = mysql-binserver-id = 2 to add replication account grant replication slave on *. * to rep@'192.168.0.%' identified by '123456" in master library [mysqld]; synchronize master database to slave database (1) lock table method (cannot exit when locking table, exit is invalid) flush table with read lock # Lock table mysql > show master status # Lock the location point of the table record +-+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +- -+ | mysql-bin.000002 | 253 | +-- -+ mysqldump-uroot-p123456-- events-A-B | gzip > / opt/bak_$ (date +% F). Sql.gz # the method of comparing soil with-F cutting binlog may not butt show master status If the location is the same, the locking table will take effect. If it is different, the unlock tables; unlocking table will be unlocked from the slave database. (2) the unlocking table method mysqldump-uroot-p123456-A-B-F-- master-data=2-x-- events | gzip > / opt/all.sql.gz show master status View the recorded location point restore the file mysql-uroot-p123456 set global rpl_semi_sync_master_enabled=on;# unzipped from the library gzip-d bak_xxx.sql.gz # load the plug-in mysql > INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave.so';mysql > set global rpl_semi_sync_slave_enabled=on from the library 3.2 add my.cnf parameter # main library [mysqld] add the following parameter rpl_semi_sync_master_enabled = 1 # slave library [mysqld] add the following parameter rpl_semi_sync_slave_enabled = 1
View parameters
Show variables like'% Rpl%';3.3 verifies show global status like 'rpl_semi%' +-+-+ | Variable_name | Value | +-+- -+ | Rpl_semi_sync_master_clients | 1 | Rpl_semi_sync_master_net_avg_wait_time | 0 | Rpl_semi_sync_master_net_wait_time | 0 | Rpl_semi_sync_master_net_waits | 0 | Rpl_semi_sync_master_no_times | 0 | Rpl_semi_ Sync_master_no_tx | 0 | Rpl_semi_sync_master_status | ON | | Rpl_semi_sync_master_timefunc_failures | 0 | Rpl_semi_sync_master_tx_avg_wait_time | 0 | Rpl_semi_sync_master_tx_wait_time | 0 | Rpl_semi_sync_master_tx_waits | 0 | | Rpl_semi_sync_master_wait_pos_backtraverse | 0 | Rpl_semi_sync_master_wait_sessions | 0 | | Rpl_semi_sync_master_yes_tx | 0 | +-+
Mysql > show global status like 'rpl_semi%' +-- +-+ | Variable_name | Value | +-+-+ | Rpl_semi_sync_slave_status | ON | +- -+
4 Test
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
MySQL5.7+keepalive+ enhanced semi-synchronous build document
© 2024 shulou.com SLNews company. All rights reserved.