"mysql case" Error.log warning:if A crash happens thisconfiguration does not guarantee that the relay LO

Source: Internet
Author: User
<span id="Label3"></p><p><p>1.1.1. If A crash happens thisconfiguration does not guarantee that the relay log info would be consistent</p></p><p><p>"narrative Description of the environment"</p></p><p><p>msyql5.6.14</p></p><p><p>"error message"</p></p><p><p>When MySQL slave starts, a warning warning appears in error.log:</p></p><p><p>[Warning] Slave sql:if A crash happensthis configuration does not guarantee that the relay log info would beconsistent, error_code: 0</p></p><p><p>This warning information has no effect on MySQL and MySQL replication Functionality.</p></p><p><p>"cause of error"</p></p><p><p>The MySQL5.6 version number starts with support for writing the contents of Master.info and relay-log.info to a table in the MySQL library.</p></p><p><p>Master.info--> Mysql.slave_master_info</p></p><p><p>Relay-log.info--> Mysql. Slave_relay_log_info</p></p><p><p>At the same time in the MySQL5.6 version number, added the <strong>Slave crash-safe replication</strong> function, in order to ensure that the MySQL replication can Crash-safe. The Slave_master_info and Slave_relay_log_info tables must use the transactional storage engine (InnoDB) and do not attempt to manually change the contents of the two Tables.</p></p><p><p>At the same time, slave also to turn on the Relay_log_recovery Function.</p></p><p><p>"workaround"</p></p><p><p>Set the value of Master_info_repository and Relay_log_info_repository to Table. Turn on the Relay_log_recovery function at the same time.</p></p><p><p></p></p><p><p>To change THE/ETC/MY.CNF configuration file, Add the following 3 items:</p></p><p><p>Master-info-repository=table # Ability to use set global dynamic changes</p></p><p><p>Relay-log-info-repository=table # Ability to use Setglobal dynamic changes</p></p><p><p>Relay-log-recovery=1 # Only read the number of references, you must change my.cnf restart MySQL</p></p><p><p>Then restart the MySQL instance.</p></p><p><p></p></p><p><p></p></p><p><p>"references"</p></p><p><p>L <strong>Master.info and Relay-log.info logs</strong></p></p><p><p>Two logs are created on the replicated slave node, respectively, master.infor and relay-log.info, located in the DataDir folder. In the MySQL5.6 and maybe version numbers, you can specify the table to be written to MySQL or write to the file by setting the <span style="color:#02678A">master-info-file</span> and <span style="color:#02678A">relay-log-info-file</span> Parameters.</p></p><p><p>These two files include information similar to the Showslave status output, which reads Master.info and relay-log.info files when slave is started to determine which binary log is read from master and reads the relay log.</p></p><p><p>The slave I/O thread is responsible for updating the maintenance Master.info file,</p></p> <table cellpadding="0" cellspacing="0" border="1" width="642"> <tbody> <tr> <td valign="top"><p><strong>Master.info</strong></p></td> <td valign="top"><p><strong>Mysql.slave_master_info</strong></p></td> <td nowrap valign="top"><p><strong>SHOW SLAVE STATUS Column</strong></p></td> <td valign="top"><p><strong>Description</strong></p></td> </tr> <tr> <td nowrap valign="top"><p>1</p></td> <td nowrap valign="top"><p>Number_of_lines</p></td> <td nowrap valign="top"><p>[None]</p></td> <td valign="top"><p>Number of lines in the file</p></td> </tr> <tr> <td nowrap valign="top"><p>2</p></td> <td nowrap valign="top"><p>Master_log_name</p></td> <td nowrap valign="top"><p>Master_log_file</p></td> <td valign="top"><p>The name of the master binary log currently being read from the master</p></td> </tr> <tr> <td nowrap valign="top"><p>3</p></td> <td nowrap valign="top"><p>Master_log_pos</p></td> <td nowrap valign="top"><p>Read_master_log_pos</p></td> <td valign="top"><p>The current position within the master binary log that has been read from the master</p></td> </tr> <tr> <td nowrap valign="top"><p>4</p></td> <td nowrap valign="top"><p>Host</p></td> <td nowrap valign="top"><p>Master_host</p></td> <td valign="top"><p>The host name of the master</p></td> </tr> <tr> <td nowrap valign="top"><p>5</p></td> <td nowrap valign="top"><p>User</p></td> <td nowrap valign="top"><p>Master_user</p></td> <td valign="top"><p>The user name used to connect to the master</p></td> </tr> <tr> <td nowrap valign="top"><p>6</p></td> <td nowrap valign="top"><p>User_password</p></td> <td valign="top"><p>Password (not shown by SHOW SLAVE STATUS)</p></td> <td valign="top"><p>The password used to connect to the master</p></td> </tr> <tr> <td nowrap valign="top"><p>7</p></td> <td nowrap valign="top"><p>Port</p></td> <td nowrap valign="top"><p>Master_port</p></td> <td valign="top"><p>The network port used to connect to the master</p></td> </tr> <tr> <td nowrap valign="top"><p>8</p></td> <td nowrap valign="top"><p>Connect_retry</p></td> <td nowrap valign="top"><p>Connect_retry</p></td> <td valign="top"><p>The period (in Seconds) that the slave would wait before trying to reconnect to the master</p></td> </tr> <tr> <td nowrap valign="top"><p>9</p></td> <td nowrap valign="top"><p>Enabled_ssl</p></td> <td nowrap valign="top"><p>Master_ssl_allowed</p></td> <td valign="top"><p>Indicates whether the server supports SSL connections</p></td> </tr> <tr> <td nowrap valign="top"><p>10</p></td> <td nowrap valign="top"><p>Ssl_ca</p></td> <td nowrap valign="top"><p>Master_ssl_ca_file</p></td> <td valign="top"><p>The file used for the Certificate authority (CA) Certificate</p></td> </tr> <tr> <td nowrap valign="top"><p>11</p></td> <td nowrap valign="top"><p>Ssl_capath</p></td> <td nowrap valign="top"><p>Master_ssl_ca_path</p></td> <td valign="top"><p>The path to the Certificate authority (CA) certificates</p></td> </tr> <tr> <td nowrap valign="top"><p>12</p></td> <td nowrap valign="top"><p>Ssl_cert</p></td> <td nowrap valign="top"><p>Master_ssl_cert</p></td> <td valign="top"><p>The name of the SSL certificate file</p></td> </tr> <tr> <td nowrap valign="top"><p>13</p></td> <td nowrap valign="top"><p>Ssl_cipher</p></td> <td nowrap valign="top"><p>Master_ssl_cipher</p></td> <td valign="top"><p>The list of possible ciphers used in the handshake for the SSL connection</p></td> </tr> <tr> <td nowrap valign="top"><p>14</p></td> <td nowrap valign="top"><p>Ssl_key</p></td> <td nowrap valign="top"><p>Master_ssl_key</p></td> <td valign="top"><p>The name of the SSL key file</p></td> </tr> <tr> <td nowrap valign="top"><p>15</p></td> <td nowrap valign="top"><p>Ssl_verify_server_cert</p></td> <td nowrap valign="top"><p>Master_ssl_verify_server_cert</p></td> <td valign="top"><p>Whether to verify the server certificate</p></td> </tr> <tr> <td nowrap valign="top"><p>16</p></td> <td nowrap valign="top"><p>Heartbeat</p></td> <td nowrap valign="top"><p>[None]</p></td> <td valign="top"><p>Interval between replication heartbeats, in seconds</p></td> </tr> <tr> <td nowrap valign="top"><p>17</p></td> <td nowrap valign="top"><p>Bind</p></td> <td nowrap valign="top"><p>Master_bind</p></td> <td valign="top"><p>Which of the slave ' s network interfaces should be used for connecting to the master</p></td> </tr> <tr> <td nowrap valign="top"><p>18</p></td> <td nowrap valign="top"><p>Ignored_server_ids</p></td> <td nowrap valign="top"><p>Replicate_ignore_server_ids</p></td> <td valign="top"><p>The number of server IDs to is ignored, followed by the actual server IDs</p></td> </tr> <tr> <td nowrap valign="top"><p>19</p></td> <td nowrap valign="top"><p>Uuid</p></td> <td nowrap valign="top"><p>Master_uuid</p></td> <td valign="top"><p>The master ' s unique ID</p></td> </tr> <tr> <td nowrap valign="top"><p>20</p></td> <td nowrap valign="top"><p>Retry_count</p></td> <td nowrap valign="top"><p>Master_retry_count</p></td> <td valign="top"><p>Maximum number of reconnection attempts permitted Added in MySQL 5.6.1)</p></td> </tr> </tbody> </table><p><p></p></p><p><p>Slave's SQL Thread is responsible for maintaining the Relay-log.info file, and in MySQL5.6 Relay-log.info includes the number of records in the file and the number of seconds of replication delay.</p></p> <table cellpadding="0" cellspacing="0" border="1" width="642"> <tbody> <tr> <td nowrap valign="top"><p><strong>Relaylog.info</strong></p></td> <td nowrap valign="top"><p><strong>Slave_relay_log_info</strong></p></td> <td nowrap valign="top"><p><strong>SHOW SLAVE STATUS</strong></p></td> <td valign="top"><p><strong>Description</strong></p></td> </tr> <tr> <td nowrap valign="top"><p>1</p></td> <td nowrap valign="top"><p>Number_of_lines</p></td> <td nowrap valign="top"><p>[None]</p></td> <td valign="top"><p>Number of lines in the file or rows in the table</p></td> </tr> <tr> <td nowrap valign="top"><p>2</p></td> <td nowrap valign="top"><p>Relay_log_name</p></td> <td nowrap valign="top"><p>Relay_log_file</p></td> <td valign="top"><p>The name of the current relay log file</p></td> </tr> <tr> <td nowrap valign="top"><p>3</p></td> <td nowrap valign="top"><p>Relay_log_pos</p></td> <td nowrap valign="top"><p>Relay_log_pos</p></td> <td valign="top"><p>The current position within the relay log file; Events up to this position has been executed on the slave database</p></td> </tr> <tr> <td nowrap valign="top"><p>4</p></td> <td nowrap valign="top"><p>Master_log_name</p></td> <td nowrap valign="top"><p>Relay_master_log_file</p></td> <td valign="top"><p>The name of the master binary log file from which the events in the relay log file were read</p></td> </tr> <tr> <td nowrap valign="top"><p>5</p></td> <td nowrap valign="top"><p>Master_log_pos</p></td> <td nowrap valign="top"><p>Exec_master_log_pos</p></td> <td valign="top"><p>The equivalent position within the master ' s binary log file of events that has already been executed</p></td> </tr> <tr> <td nowrap valign="top"><p>6</p></td> <td nowrap valign="top"><p>Sql_delay</p></td> <td nowrap valign="top"><p>Sql_delay</p></td> <td valign="top"><p>The number of seconds that the slave must lag the master</p></td> </tr> </tbody> </table><p><p></p></p><p><p>Set Master_info_repository and Relay_log_info_repository parameters:</p></p><p><p>Sql> Stop slave;</p></p><p><p>Sql> Set Global master_info_repository=table;</p></p><p><p>Sql> Set Global relay_log_info_repository=table;</p></p><p><p>Sql> Show variables like '%repository ';</p></p><p><p>+--------------------------------------+---------+</p></p><p><p>| variable_name | Value |</p></p><p><p>+--------------------------------------+---------+</p></p><p><p>| Master_info_repository | TABLE |</p></p><p><p>| Relay_log_info_repository | TABLE |</p></p><p><p>+--------------------------------------+----------+</p></p><p><p></p></p><p><p>To view a log read to Master:</p></p><p><p>Sql> SELECT * from slave_master_info;</p></p><p><p>To view Slave's relay log application:</p></p><p><p>Sql> SELECT * from slave_relay_log_info;</p></p><p><p></p></p><p><p><strong>Attention:<br></strong>The data in Master.info and Relay-log.info can be delayed, depending on when MySQL brushes slave information to the hard disk, assuming slave real-time information can be queried for slave_master_info and Slave_ Relay_log_info the table, or run show slave status View.</p></p><p><p></p></p><p><p></p></p><p><p>L Master-info-repository</p></p><p><p>Master-info-repository={FILE | TABLE}, The default value is File. This parameter is used to set the slave node to write the master information to a physical file or to Mysql. The Slave_master_info Table.</p></p><p><p>Assume that it is set to File. MySQL is also the default settings, slave will record the master information in the Datadir/master.info file, starting from the MySQL5.6 version number, we recommend the use of table Mode.</p></p><p><p></p></p><p><p>L Relay-log-info-reposity</p></p><p><p>Relay-log-info-reposity=file|table. The default value is File. This parameter is used to set the slave node to write relay-log.info information to the Datadir/relay-log.info file or to Mysql. Slave_relay_log_info Table.</p></p><p><p>Assuming that it is set to file and is the default for mysql, slave will record the master information in the Datadir/master.info file, starting with the MySQL5.6 version number, and we recommend using table Mode.</p></p><p><p></p></p><p><p>L Relay-log-recovery</p></p><p><p>relay-log-recover=0|1, The default value is 0 does not turn On. This parameter is used to set whether to turn on relay Log's own proactive Recovery Function.</p></p><p><p>When the Relay_log_recovery function is turned on, the slave database will ignore the relay log that is not running when it is Started. It will connect to master again to get relay log for Recovery.</p></p><p><p>When the slave has Crashed. It is recommended to enable this feature to effectively prevent slave from running the corruption record in relay log.</p></p><p><p></p></p><p><p>Assuming the Relay_log_recovery function is turned on, we have the same time to relay_log_info_reposity to table State.</p></p> <p style="font-size:12px;"><p style="font-size:12px;">Copyright Notice: This article Bo master original Article. blog, not reproduced without Consent.</p></p> <p><p>"mysql case" Error.log warning:if A crash happens thisconfiguration does not guarantee that the relay LO</p></p></span>

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.