In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
One: master-slave replication
Principle
Master records the changes in the binary log (Binary log)
Slave copies the binary log of master to its relay log (relay log)
Slave starts a worker thread-I _ big O thread. The Imaster O thread opens a normal connection on master, then starts binlog dump process, reads events from the master binary log, and if it has followed master, it sleeps and waits for master to generate new events. The Icano thread writes these events to the relay log.
Slave redo events in the relay log
The SQL thread reads events from the relay log and replays the events to update slave's data to make it consistent with master's data. As long as the thread is consistent with the IWeiO thread, the relay log is usually in the cache of OS, so the overhead of the relay log is very small.
II. Separation of reading and writing
Why the separation of reading and writing?
The number of times of reading far exceeds that of writing. One master and multiple slaves, the master receives the write request, synchronizes the data to the slave database through the replication mechanism, and the slave database will set read-only to prevent the master-slave data from being inconsistent.
The main functions of the slave library are: sharing the reading pressure of the master library, performing backup tasks, and backup libraries that can be used in the event of failover.
Concentrate on writing, read separately, and divert the pressure.
III. Sub-database and sub-table
Sharding, which is often called sub-database and sub-table, redistributes data through certain strategies, mainly to solve the problem of excessive writing pressure or capacity of a single instance.
Fourth, data preheating
Put hot data (frequently accessed by users) in the cache to reduce the pressure on the database, Redis cache server (cluster)
For example, the service will be restarted when the service is launched, and the cached data will be gone, so the data will be re-cached and then accessed externally.
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.