MySQL master-slave replication architecture and implementation Miscellaneous 1, set slave node as read-only modeMariaDB [(None)]> SHOW GLOBAL VARIABLES like ' read_only '; +---------------+-------+| variable_name | Value |+---------------+-------+|
This article describes MySQL log management in detail. This article describes log types, log functions, and common server variables related to MySQL logs, if you need it, you can refer to the log file. it is very important for a server. it records
Log files are very important for a server, it records the operation of the server information, many operations will be written to log files, through the log file can monitor the running state of the server and view the performance of the server, but
Mysql Log System, mysql LogLogs
Mysql Log classification:
Server logs
Records special events during the process startup and running to help you analyze problems encountered by the mysql service.
Capture specific SQL statements as needed
Files in MySQLParameter file: MySQL configuration file, save the configuration information of MySQL. File name my.cnfBy default, the MySQL instance reads the configuration file in a certain order in the specified file, and the user canMySQL--help |
Log
Categories of MySQL logs:
Server logs
Records special events during the process startup process, helping to analyze problems that the MySQL service encounters.
Capture specific SQL statements as needed to
One, log type:
MySQL has several different log files that can help you find out what's going on inside Mysqld:
The type of information that the log file is logged into the fileThe error log records issues that occur when you start, run, or
Here is the MHA from boot, to failover's complete manager.log, and all of the MySQL General.log in the cluster. We can learn more about the workings of MHA through these logs. There is a lot of help in using good MHA.The architecture is as
Since the introduction of the InnoDB engine in MySQL, in MySQL support transactions, the transaction is a set of atomic query statements, but also a number of queries as a separate unit of work, usually by submitting a unit of work to complete the
MySQL log features detailed query, slow queryMySQL log: A large number of IO operations are not recommended to write to a fileMysql> show global variables like ' innodb% ';mysql> show global variables like '%log% '; General_log | OFF Log |
MySQL master-slave replication architecture and implementation of MySQL master-slave replication configuration
Master node:
Start binary Log
Set a globally unique ID number (Server-id) for the current node
Create a
1 OverviewSemi-synchronous replication refers to a subset of host synchronous replication, and another part of the host asynchronous replicationThe logic of synchronization is that the user writes to the primary server, the primary service is logged
Read/write separationGenerally we are only responsible for the client's read request from the server side, the main service side is responsible for writing the request. Then configure it!First look at whether read-only mode is turned on from the
The so-called slow query is the query time of a SQL statement more than the predefined well-defined query time, these statements are to be recorded for the use of statement optimization, the following is how to record the slow query statement method:
Slow query: the query time of an SQL statement exceeds the predefined query time. These statements must be recorded for statement optimization. The following describes how to record slow queries.
Slow query: the query time of an SQL statement
MySQL Log category:General query logs: log, general_log, log_outputSlow query log: the query execution time exceeds the specified query time, that is, the slow query;Error Log: generally refers to the error log information, usually the log
The logs in MYSQL/MARIADB are broadly divided into the following categories:Query LogGeneral Query log:Slow query log:error LogBinary logRelay LogTransaction logA brief introduction to these kinds of logs, logs for our analysis of MySQL service has
How does MySQL calculate the number of opened files each time a MyISAM table is opened, two file descriptors are required. let's verify how MySQL calculates the number of opened files.
I. test
We can see from the manual "6.4.8. How MySQL Opens and
Mysql also supports semi-synchronous replication in master-slave replication. mysql replication is asynchronous because of poor synchronization performance. After the master database delivers an event, you must wait for the slave database to copy
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.