In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
With the advent of the era of big data, data is particularly important. The loss or destruction of data can even destroy a company.
The master-slave hot backup under Linux is actually very simple.
1. As the primary server Master, it records every change in its binary log Binarylog. (it is the responsibility of the server to read the log and then execute it again at your own place. ) 2. As a slave server Slave, it logs in to master with the account on master, reads master's Binarylog, writes to its own relay log Relaylog, and then its own SQL thread reads the relay log and executes it again. At this point, the changes on the master server are synchronized to the slave server. The following specific configuration methods are described below: master and slave means that there are no less than two servers. Here, 192.168.0.1 (master server database) 192.168.0.2 (slave server database) is taken as an example:
Master server master configuration [mysqld]
Datadir=/var/lib/mysql
Socket=/var/lib/mysql/mysql.sock
User=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
Symbolic-links=0 server-id=1
Log-bin=mysql-bin
Relay-log=relay-bin
Relay-log-index=relay-bin-index [mysqld_safe]
Log-error=/var/log/mysqld.log
Pid-file=/var/run/mysqld/mysqld.pid
Configure currency symbols from server Slave
[mysqld]
Datadir=/var/lib/mysql
Socket=/var/lib/mysql/mysql.sock
User=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
Symbolic-links=0
Server-id=2 # cannot be the same as the primary server
Log-bin=mysql-bin
Replicate-do-db=test # Select a hot backup database
Log-slave-updates=1 [mysqld_safe]
Log-error=/var/log/mysqld.log
Pid-file=/var/run/mysqld/mysqld.pid
When the configuration is complete, login Slave, and then execute the following command: mysql > stop slave
Mysql > change master to master_host='192.168.0.1',master_user='root',master_password='123456'
# configuration of the master database
Mysql > start slave
Mysql > show slave status\ G
Financial question and answer http://www.gendan5.com/topic/businessnews.html
Check whether the relevant configuration is working properly: yes is normal.
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
If either of the above two configurations is No. The hot standby cannot be carried out normally, and the specific reasons need to be checked.
Finally, when the test does anything in the test library of the master data, the test in the database of the slave server will be synchronized to this point, and the Linux master-slave hot backup data will be completed.
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.