Iptables setting after mysql master-slave synchronization is enabled

Source: Internet
Author: User

The iptables setting problem after mysql master-slave synchronization is enabled is that the two are performing master-slave mysql synchronization. My mysql Server version is 5.6.10, and mysql5.6 is used for master-slave synchronization, the official recommendation is to put the information in master.info in the database. There are already many examples of mysql master-slave synchronization in the master.info table in the mysql database. Now I am mainly talking about my problems, the master-slave synchronization settings are smooth. A brief description: Execute SQL flush tables with read lock in the master database; view the binlog record of the master database: show master status; back up the master database: 1. You can package the database: tar-zcvf/backup/mysql_dump.tar.gz/var/lib/mysql 2. You can use the mysql tool mysqldump: mysqldump -- user = root-h 127.0.0.1 -- databases test_repl -- default-character-set = utf8 -- lock-all-tables>/backup/test_repl. SQL Restore database 1 and tar packages from the database directly decompress the package to the directory where mysql stores the database, modify the file to the mysql permission. 2. Run mysqldump: mysql-uroot-p123456 <test_repl. SQL to restore the database, and set the synchronization information from the database: change master to master_host = 'master database ip ', master_user = 'synchronize user name', master_password = 'synchronize user password', master_port = 3306, master_log_file = 'Log file', master_log_pos = Location of the log file; start slave from the Database Synchronization Service; release the read locks of the primary database and run unlock tables on the primary database; run show slave status \ G on the database to check whether the slave Database Synchronization status is correct. The Master/slave server firewall is set on the master database. You only need to release mysql tcp to iptables-A-p tcp -- dport 3306. -j ACCEPT must simultaneously release tcp udp of mysql on the slave server: iptables-A-p tcp -- dport 3306-j ACCEPT iptables-A-p udp -- dport 3306-j ACCEPT so that the master-slave synchronization can run normally.
 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.