Discover mysql replication status, include the articles, news, trends, analysis and practical advice about mysql replication status on alibabacloud.com
/MY.CNF (the configuration file in Windows is Mysql.ini)Log-bin=mysql-bin Open Binary LogNote: The binary log must be turned on because the synchronization of the data is essentially the other MySQL database server executes the binary log of this data change again on this computer.192.168.95.11 Primary database server192.168.95.12 from the database serverBack to top 3.3, start building master-slave replicat
.
2. Create an account dedicated to replication on the master: weidai/123456
The newly added account can be queried in the mysql. user table:
During my first operation, the account was created here, but it was found that the account was not copied successfully, check whether the binlong generated by the master node is correct during troubleshooting. Then, check the slave
.
Master-Slave Replication configuration steps:
Set Server-id (server identity, which cannot be duplicated in a group of hosts)
Turn on the binary log and specify the path to save the binary log file
Record Bin-log files and bin-log (position) locations
If you keep on master, add a global lock, backup the database that needs to be synchronized to the slave node, and unlock the global lock.
Create a user for synchronous
= 2Auto_increment_offset = 1
Node B:
Log-bin = mysql-binServer-id = 2Binlog-do-db = testBinlog-ignore-db = mysqlReplicate-do-db = testReplicate-ignore-db = mysqlLog-slave-updatesSync_binlog = 1Auto_increment_increment = 2Auto_increment_offset = 2
After the configuration is changed, you must start mysql before proceeding to the next step.
Each AB node creates an account accessed by the other Party:
Grant
, mutual authorized users (in a server authorized a user to allow B access, and vice versa)On Server A (192.168.1.254)Mysql> GRANT REPLICATION SLAVE on * * to ' mysync ' @ ' 192.168.1.252 ' identified by PASSWORD ' 123456 ';mysql> flush Privileges;On Server B (192.168.1.252)Mysql> GRANT
MySQL uses show status to view the status of the MySQL server, statusmysql
During website development in the LAMP architecture, we sometimes need to know the MySQL server status information, such as the running time after
Build a MYSQL master-slave replication structure and a mysql master-slave replication Structure
1. Select two servers as the master and backup databases respectively.
2. log on to the server,
Yum install mysql;
Yum install mysql-s
Slave_ SQL _Running are No
It indicates that the replication process has not started. The log location is 4 rather than 0, because 0 is the start position of the log file, not the log location. In fact, MySQL knows that the first event is located at 4.
To start replication, you can run:
Mysql> start slave;
Run show sl
/mysql.sock4.3 Initialize master, slave all nodes, and start/application/mysql/scripts/mysql_install_db--basedir=/application/mysql--datadir=/application/mysql/data--user =mysql/etc/init.d/mysqld start4.4master Node Authorized user Replmysql> gant replication Slave on * * to
ArticleDirectory
If MongoDB is just a document-type database, there is no bright spot. However, the biggest advantage of MongoDB is read extension, hot backup, fault recovery, and automatic sharding (write extension ). These functions will be introduced at the end of this series.
1. Status Monitoring
2. Backup and Replication
3. Automatic sharding
If MongoDB is just a document-type dat
> Show databases;+--------------------+| database |+--------------------+| Information_schema | | mysql | | PErformance_schema | | sys | | test |+--------------------+5 rows in Set (0.00 sec) to slave data recovery Mys Ql> source/mysql/test3.sqlmysql> show databases;+--------------------+| database |+--------------------+| Information_schema | | m
replication permissionsExecute separately on both machinesMysql>grant replication Slave on * * to ' login username ' @ ' The other's IP address ' identified by ' give each other login password ';Note: this is *. *, can only configure all databases because replication slave permissions can only be used for the global database, that is why we second step in the co
hosts)
2. configure master:
[Root @ localhost mysql] # vi/etc/my. cnf // edit the configuration file
Server-id = 1 // The default value is 1. if not, change it to 1.
Thread_concurrency = 2 // number of concurrent threads (CPU * 2)
Log-bin = mysql-bin // enable the binary log function
Save and exit, and restart mysql.
Log on to
protected] ~]# sy Stemctl restart Mariadb[[email protected] ~]# iptables-f[[email protected] ~]# GetenforceConfigure Master master serverIncludes opening binaries, specifying a unique server IDServer-id #配置server-id, let the primary server have a unique ID numberLog-bin=mysql-bin #打开mysql日志, the log format is in binarySkip-name-resolve #关闭名称解析 (not required)[[email protected] ~]# Vim/etc/my.cnf[mysqld]serv
'repl' @ '10. 11.4.% 'identified by 'repl'; mysql> flush privileges;3. Refresh the table and set read-only
# Lock the table to prohibit writing new data; # (executed as appropriate), set read-only to prevent the binlog file name and offset from being obtained, or from the master database to the slave database backup, the master database has changed. Do not forget to unlock it after the first synchronization is completed. [root @ master ~] #
from Server featureMysql>start slave; 8. Check replication feature status from serverMysql>Show Slave Status\g***************************1. Row ***************************slave_io_state:waiting forMaster to send event Master_host:192.168.145. Ten //Primary server addressMaster_user:repl//authorization account name, try to avoid using rootMaster_port:3306 /
from the server, also, to modify the MySQL configuration file (my.cnf), Server-id must not be the same as the primary serverThis can bothSave exit, restart MySQL service (service MySQL restart)Then go to MySQL and receive the log file of the master server.Do you see a lot of familiar information here?Master_host: The
1. MySQL Replication replication Processmysql Replication (replication) is an asynchronous copy, copied from a MySQL instace (called master) to another MySQL instance (called slave). Th
), if master suddenly falls down, Slave3 becomes master and slave, Slave2 will not be able to distinguish the next event position, Slave2 (POS80) is only relative slave1 Binlog in the event POSTwo. Multi-Threading using MTS (multiple thread slave) in schema, because operations on different schemas do not affect each other, so you can parallelI'm the split line ****************************************.Groupcommit (group commit), MySQL multiple commits
network card with network segment, internal no gateway, external gateway, are 192.168.36.524.The Lync Server 2013 front-end server cannot ping 192.168.36.21.SFB Edge Server replication status is not working:650) this.width=650; "height=" "title=" clip_image008 "style=" margin:0px;border:0px;padding-top:0px;padding-right : 0px;padding-left:0px;background-image:none; "alt=" clip_image008 "src=" http://s3.51c
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.