In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "parsing MySQL relay log parameters". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "parsing MySQL relay log parameters".
Root@db 16:12: [(none)] > show variables like'% relay%'
+-+
| | Variable_name | Value |
+-+
| | max_relay_log_size | 0 | |
| | relay_log |
| | relay_log_basename | / data/mysql/node2bak-relay-bin |
| | relay_log_index | / data/mysql/node2bak-relay-bin.index |
| | relay_log_info_file | relay-log.info |
| | relay_log_info_repository | TABLE |
| | relay_log_purge | ON |
| | relay_log_recovery | ON |
| | relay_log_space_limit | 0 | |
| | sync_relay_log | 10000 | |
| | sync_relay_log_info | 10000 | |
+-+
11 rows in set (0.00 sec)
Root@db 16:12: [(none)] >
Log-slave-updates:
In general, slave will not write the binlog records received from master to its own binlog. This parameter will cause slave to write the binlog received from master into its own binlog through the SQL thread, but the premise is that slave must enable its own binlog. This parameter is generally used for cascading replication. For example, if you need A to copy from B to B to C, then B should enable this parameter.
Max_relay_log_size:
Mark the maximum value allowed by relay log, if the value is 0, the default value is max_binlog_size (1G), if not 0, max_relay_log_size is
Maximum relay_log file size
Relay_log:
Define the location and name of the relay_log. If the value is empty, the default location is in the directory of the data file (datadir). The file name is host_name-relay-bin.nn.
Nnnn (By default, relay log file names have the form host_name-relay-bin.nnnnnn in the data directory)
Relay_log_basename:
The name and path of the transit log file.
Relay_log_index:
Define the location and name of relay_log as relay_log; generally, it is in the same directory as relay-log
Relay_log_info_file:
Set the location and name of relay-log.info (relay-log.info records the recovery location of MASTER's binary_log and the location of relay_log)
Relay_log_info_repository:
Determine whether the slave relay_log location is placed in FILE (relay-log.info) or TABLE (mysql.slave_relay_log_info) to ensure the consistency of data writing.
Relay_log_purge:
Turn on or off automatic deletion of transit logs when not needed. It is enabled by default (1), which is a global variable and can be accessed by SET GLOBAL relay_log_purge =
N dynamic setting.
Relay_log_recovery:
When slave goes down from the library, if the relay-log is corrupted, resulting in part of the relay log not being processed, all outstanding relay-log will be automatically discarded and re-executed.
Get the log from master, which ensures the integrity of relay-log. By default, this feature is turned off and the value of relay_log_recovery is set to 1
This feature can be enabled on the slave slave library. It is recommended to enable it.
Relay_log_space_limit:
To prevent the relay log from filling up the disk, set the maximum limit for the relay log here. However, in this setting, the main database crashes and the relay log from the library is incomplete.
Already, not recommended
Sync_relay_log:
This parameter is the same as sync_binlog. When set to 1, the I / O thread of slave will write to the system every time the binlog log sent by master is received.
Buffer, and then flush it into the relay log relay log, which is the safest, because in the event of a crash, you will lose at most one transaction, but it will cause the disk to
A large number of Icano.
When set to 0, it is not immediately brushed into the relay log, but is decided by the operating system when to write, although the security is reduced, but a lot of magnetism is reduced.
Disk IPUBO operation. This value defaults to 0 and can be modified dynamically. It is recommended to use the default value.
Sync_relay_log_info:
This parameter is the same as the sync_relay_log parameter. When set to 1, the I / O thread of slave will write the binlog log every time it receives the binlog log sent by master.
System buffer, and then flush into the relay-log.info, this is the safest, because in the event of a crash, you will lose at most one transaction, but will cause disk
A large number of Icano. When set to 0, it is not immediately brushed into the relay-log.info, but is decided by the operating system when to write, although the security is reduced, but
Reduced a large number of disk Ihop O operations. This value defaults to 0 and can be modified dynamically. It is recommended to use the default value.
The following configurations are recommended from the library online environment
# relay log
Max_relay_log_size = 0
Relay_log=$datadir/relay-bin
Relay_log_purge = 1
Relay_log_recovery = 1
Sync_relay_log = 0
Sync_relay_log_info = 0
If it is a mha environment, do not enable relay_log_purge, set it to 0, and you can use purge_relay_logs to clear it periodically.
Thank you for your reading, the above is the content of "parsing MySQL relay log parameters", after the study of this article, I believe you have a deeper understanding of the problem of parsing MySQL relay log parameters, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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: 210
*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.