In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
5.6 default value 0, to 5.7 default is 1
Sync_binlog
Command-Line Format--sync-binlog=#System VariableNamesync_binlogVariable ScopeGlobalDynamic VariableYesPermitted Values (32-bit platforms) TypeintegerDefault0Min Value0Max Value4294967295Permitted Values (64-bit platforms) TypeintegerDefault0Min Value0Max Value4294967295
If the value of this variable is greater than 0, the MySQL server synchronizes its binary log to disk (using fdatasync ()) after sync_binlog commit groups are written to the binary log. The default value of sync_binlog is 0, which does no synchronizing to disk-in this case, the server relies on the operating system to flush the binary log's contents from time to time as for any other file. A value of 1 is the safest choice because in the event of a crash you lose at most one commit group from the binary log. However, it is also the slowest choice (unless the disk has a battery-backed cache, which makes synchronization very fast).
If the value of this variable is greater than 0Jing MySQL server synchronizes the binary log to disk (using fdatasync ()), sync_binlog violates the group and writes the binary log. The default value of sync_binlog is 0 and is not synchronized in this case, the disk, the server depends on the operating system's binary log content refresh time for any other file. A value of 1 is the safest choice because in a crash event, you lose the most committed group from the binary log. However, it is also the slowest choice (unless the disk has a cache for battery backup, which makes synchronization very fast).
Sync_binlog=1 or N This makes MySQL synchronize the binary log's contents to disk each time it commits a transaction by default, binlog is not synchronized with the hard drive every time you write. So if the operating system or machine (not just the MySQL server) crashes, it's possible that the last statement in binlog is lost. To prevent this, you can use the sync_binlog global variable (1 is the safest value, but also the slowest) to synchronize binlog with the hard drive after every N binlog writes. Even if sync_binlog is set to 1, it is possible that there is an inconsistency between the table content and the binlog content in the event of a crash. If you use the InnoDB table, the MySQL server processes the COMMIT statement, which writes the entire transaction to binlog and commits the transaction to InnoDB. If a crash occurs between operations, the transaction is rolled back by the InnoDB on restart, but still exists in the binlog. You can use the-- innodb-safe-binlog option to increase consistency between InnoDB table contents and binlog. (note: not needed in MySQL 5.1This option is invalidated by innodb-safe-binlog; due to the introduction of XA transaction support.) this option provides greater security so that the binlog (sync_binlog = 1) and (true by default) InnoDB logs for each transaction are synchronized with the hard disk. The effect of this option is that when you restart after a crash, the MySQL server cuts the rolled InnoDB transactions from binlog after the transaction is rolled back. This ensures that binlog feeds back the exact data of the InnoDB table, and so on, and keeps the slave server synchronized with the master server (no rollback statements are received).
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: 0
*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.