In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
One master and one slave
Hot standby with dual seats
1.log-bin must be open
Enter the mysql view status. If ON means to enable, OFF means to disable
Show variables like'% log_bin%'
two。 Set log-bin to ON. Note that there are two my.cnf settings for both the mysql host and the slave.
Path 1:/opt/rh/mysql55/root/etc/my.cnf installation path, priority over / etc/my.cnf
Path 2:/etc/my.cnf
Host master
Set up my.cnf
[mysqld]
Log-bin=mysql-bin / / [must] enable binary logging
Server-id=23 / / [required] the server has a unique ID. The default is 1. Generally, the last segment of IP is taken.
Restart the service
Service mysql55-mysqld restart
Set the access permissions of the standby phone
-- REPLICATION SLAVE this is a global replication, and this REPLICATION SLAVE is a global permission
-- it involves modifying data through an external zxlh account and giving the zxlh account the right to back up in real time.
GRANT REPLICATION SLAVE ON *. * TO zxlh@'10.50.28.24' IDENTIFIED BY 'zxlh'
If you can't locate the problem, check var/log/mysql55-mysqld.log. The error log is in this file.
Check to see if the host is set up
Show master status
+-+
| | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | |
+-+
| | mysql-bin.000004 | 308 |
Standby machine
Set up my.cnf
[mysqld]
Log-bin=mysql-bin / / [must] enable binary logging
Server-id=24 / / [required] the server has a unique ID. The default is 1. Generally, the last segment of IP is taken.
Standby machine
Change master to master_host='10.50.28.23',master_user='zxlh',master_password='zxlh',master_log_file='mysql_bin.000011',master_log_pos=11137524
Change master to master_host='10.50.28.23',master_user='zxlh',master_password='zxlh',master_log_file='mysql_bin.000025',master_log_pos=27133152
Change master to master_host='10.50.30.35',master_user='zxlh',master_password='zxlh223456',master_log_file='mysql-bin.000023',master_log_pos=499382400
Start slave; / / start the copy from server function
Check standby status
Show slave status\ G
Slave_IO_Running: Yes / / this status must be YES
Slave_SQL_Running: Yes / / this status must be YES
Note: the Slave_IO and Slave_SQL processes must be running normally, that is, the YES state, otherwise they are all in the wrong state (for example, one of the NO is wrong).
The configuration of the master and slave server is completed during the above operation process.
Show master status\ G
Clear logs before 2015-05-22
Purge master logs before '2015-05-22 0000RV 0000'
View the log
Show master logs
PS: it is best not to add triggers that change the data from the library, which will cause repeated changes to the data.
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
© 2024 shulou.com SLNews company. All rights reserved.