Discover mysql replication status, include the articles, news, trends, analysis and practical advice about mysql replication status on alibabacloud.com
Label:After two hosts A and B build the MySQL master-slave copy relationship (A is master,b to slave), the show slave status is executed on slave, and the results show last_io_error:error connecting to Master ' [ Email protected]:3306 ' ... First, look at the error log file for B, and find the following error: ERROR] Slave I/o: Error connecting to master ' [email protected]:3306 '-retry-time:60 retries:2,
Label: In a MySQL replication environment, we usually only judge the latency of the slave based on the value of the seconds_behind_master . This is acceptable in most cases, but is not accurate enough and should be considered for more factors. First, let's look at the state of slave: [Email protected] [(none)]> show slave status\g
*************************** 1. R
the status of all scheduled jobs
Show Profile[Types] [for query N] [offset N] [limit N]
-- Display other information
Show open tables[From db_name] []
Show[Full]Processlist-- Display the connection process of the server
Show[Global | session]Status[]
Show[Global | session]Variales[]
Show errors[Limit [offset,] row_count] -- Display Error
Show warnings[Limit [offset,] row_count] -- Di
MySQL performance tuning and Architecture Design-Chapter 1 Performance Design-MySQL Replication and replication Optimization
Chapter 1 scalability design-MySQL Replication
Preface:
MySQL
recommend that you open an account.
Mysql>Grant replication client, replication slave on *. * TO repl @ '1. 1.1.2 'identified BY '123 ';
Mysql>Flush privileges;
Replication client allows the use of show status on the
... execute >reset SLAVE; then re-execute the >change MASTER to that statement. >show SLAVE status\g (see if Io_thread and sql_thread are on )>stop SLAVE Io_thread; (slave-side io_thread can be stopped if there is a problem with the data on Master )Slave-side Restart mysqld,io_thread and sql_thread will start automatically, data directory /mydata/data/ Relay-log.info and master.info These two files are the basis and premise of
The ultimate goal of data replication is to synchronize the data of one server with the data of another server, which can achieve data redundancy or load balancing of services. A master server can connect multiple slave servers, and the slave server can act as the master server in turn. The master-slave server can be located in different network topologies. Due to the powerful mysql
MySQL replication is primarily replicated from the primary master.
What is master-slave replication
Master-slave replication means that there is a single device to do as the primary server, one or more servers as from the server. No data is written from the server, and the source of the data is the primary server. Th
directory of the slave server. Relay dayLogs are in the same format as binary logs and can be read using mysqlbinlog. When the SQL thread completes the relay logAfter all events, relay logs are automatically deleted.The slave server creates two more state files in the data directory-master.info and relay-log.info. Save Status FileOn the hard disk, the slave server will not be lost when it is disabled. When starting the next time from the server, read
scenario, there will be some changes in the basic steps. The simplest scenario is a newly installed master and slave, and from the top, the whole process is as follows:(1) Create a copy account on each server;(2) Configuring Master and slave;(3) Slave connection master begins replication.2.1. Create a Copy AccountEach slave uses a standard MySQL username and password to connect to master. The user who make
the binary file log is not generated for the specified database, add the following statement:
Binlog-ignore-db-db_name (database name)
③ Restart the mysql service. You can see "binary_log. number file, such as binary_log.00001. after mysql service is restarted, the binary file is generated again, and the number in the file name is increased once.
After the instance is successfully started, modify the
'; Description: 192.168.1.180 is from the node server, if you want to authorize more nodes at once, you can modify it as needed, 3, provide the initial dataset for the standby node; Lock the primary table, back up the data on the primary node, restore it to the slave node, or, if Gtid is not enabled, use the Show Master Status command on master to view the binary log file name and the event location when you back up, so that you can use it l
the mysql service;
4. Run the linux Command to go to mysql and check whether the slave is correctly started. If an exception occurs during startup, ensure that the Server Load balancer instance is started properly;
5. The newly added database is in the master-master replication chain for testing;
5. How to remove a database from an existing Master:
1. modify the
'; # replication client: the user has the right to ask where the submitter/controller is. Replication slave: required to reply to the submitter. Mysql> flush privileges;
2) set a server as a slave server
Vim/etc/My. CNF # The slave server does not need binary logs, only need to start relay log comment out log-bin and binlog_formatrelay-log = relay-bin # slave s
[Mysqld]Log-bin = mysql-bin // [required] Enable binary logServer-id = 226 // [required] unique server ID. The default value is 1. Generally, the last segment of the IP address is used.4. Restart the mysql of the two servers./Bin/mysql restart5. Create an account on the master server and authorize slave:Mysql3306/bin/mysql
copying, however, depending on the specific scenario, there will be some changes in the basic steps. The simplest scenario is a newly installed master and slave, and from the top, the whole process is as follows:(1) Create a copy account on each server;(2) Configuring Master and slave;(3) Slave connection master begins replication.2.1. Create a Copy AccountEach slave uses a standard MySQL username and pass
Label:13th. The extensible design of MySQL Replication Objective: MySQL Replication is a very distinctive feature of MySQL, and he is able to copy the data from one MySQL server Instance to the Instance of another
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.