当前位置:网站首页>Briefly describe the working principle of kept
Briefly describe the working principle of kept
2022-07-07 15:07:00 【wwzroom】
sketch keepalived working principle
keepalived The principle is vrrp The principle and lvs Combination of principles
vrrp The software implementation of the protocol , The purpose of native design is high availability ipvs service
Official website :http://keepalived.org/
function :
- be based on vrrp The protocol completes the address flow
- by vip The node where the address is located generates ipvs The rules ( Predefined in the configuration file )
- by ipvs Each part of the cluster RS Do health tests ( Check the health by visiting the specified page and returning the results )
- Call the interface based on the script to complete the functions defined in the script , This in turn affects cluster transactions .
- Support nginx、haproxy Etc
1.VRRP Network layer hardware implementation
Access to the external network within the enterprise is realized through the router , To prevent router problems , So we need two routers , But two routers ip And gateway are different , Virtualize two routers into the same ip(vip) And gateway , Let the gateway of the client point to the new gateway , Only run on one router at a time , Float at different times , To avoid conflict . When one goes wrong ,vip Will immediately float to another machine , Ensure continuous Internet access .
vrrp The working host wants to know the situation of the other host at the first time , Through the establishment of heartbeat line communication , Free for adoption arp The way to inform the other party of their working status , The working host sends free arp,( You can broadcast , It can also be unicast ), The purpose is to tell yourself that you have vip, And tell yourself your priorities , The standby node receives the message and compares it with its own priority , Your priority is lower than the working node , I don't work myself , When you can't receive free arp, Or the priority of the working node is lower than itself , Work will start from the node , At this point, get from the node vip Work on .
Firewall strategy can be used to destroy each other's heart jumpers , Because I can't receive free arp, At this point, both hosts will get vip, There will be brain cracking , If there is a brain crack , The first thing is to turn off a host keepalived service , Ensure that the service can work normally , Then find out the reason for maintenance .
2.Keepalived The structure and use of lvs Rules work
Official documents : https://keepalived.org/doc/
http://keepalived.org/documentation.html
User space core components :
vrrp stack:VIP The announcement
checkers: monitoring real server
system call: Realization vrrp The function of calling script during protocol state transition
SMTP: Mail component
IPVS wrapper: Generate IPVS The rules Netlink Reflector: Network interface WatchDog: Monitor progressControl components : Provide keepalived.conf The parser , complete Keepalived To configure
IO Multiplexer : Its own thread abstraction optimized for network purposes
Memory management components : For some general memory management functions ( Such as distribution , Redistribution , Release etc. ) Provide access
keepalived It is divided into kernel space and user space ,ipvs yes lvs Core components , adopt IPVS wrapper Component handle lvs Rule passed keepalived write in lvs Kernel space , control lvs The scheduling strategy of ,lvs Cooperation in production keepalived The use of ,netlink reflector Component implementation vip The strategy of ,VRRP Stack Realization vip float .Checkers Achieve health check , Enriched lvs The missing function of ,Keepalived The emergence of is to make up lvs Deficiency , Achieve high availability in production .SMTP It is a mail alarm service .Keepalive And nginx Cooperate , because nginx The primary and standby relationship between agents cannot be checked for health and shared , adopt Keepalived Realization . High availability of agents depends on keepalived Realization .
边栏推荐
- 知否|两大风控最重要指标与客群好坏的关系分析
- Win10 or win11 taskbar, automatically hidden and transparent
- Niuke real problem programming - Day17
- 【服务器数据恢复】戴尔某型号服务器raid故障的数据恢复案例
- 最安全的证券交易app都有哪些
- Xiaomi's path of chip self-development
- Ffmpeg --- image processing
- leetcode 241. Different Ways to Add Parentheses 为运算表达式设计优先级(中等)
- A need to review all the knowledge, H5 form is blocked by the keyboard, event agent, event delegation
- @Introduction and three usages of controlleradvice
猜你喜欢
⼀个对象从加载到JVM,再到被GC清除,都经历了什么过程?
知否|两大风控最重要指标与客群好坏的关系分析
Wechat applet - Advanced chapter component packaging - Implementation of icon component (I)
How bad can a programmer be? Nima, they are all talents
Five pain points for big companies to open source
With 8 modules and 40 thinking models, you can break the shackles of thinking and meet the thinking needs of different stages and scenes of your work. Collect it quickly and learn it slowly
Ctfshow, information collection: web6
[server data recovery] a case of RAID data recovery of a brand StorageWorks server
Niuke real problem programming - Day10
[today in history] July 7: release of C; Chrome OS came out; "Legend of swordsman" issued
随机推荐
广州开发区让地理标志产品助力乡村振兴
2. 堆排序『较难理解的排序』
CTFshow,信息搜集:web4
Zhiting doesn't use home assistant to connect Xiaomi smart home to homekit
用于增强压缩视频质量的可变形卷积密集网络
Today's sleep quality record 78 points
Es log error appreciation -- allow delete
FFmpeg----图片处理
Read PG in data warehouse in one article_ stat
Used by Jetson AgX Orin canfd
【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例
Bill Gates posted his resume 48 years ago: "it's not as good-looking as yours."
Pat grade a 1103 integer factorizatio
Navigation — 这么好用的导航框架你确定不来看看?
Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched
CTFshow,信息搜集:web6
TypeScript 发布 4.8 beta 版本
Ctfshow, information collection: web7
Niuke real problem programming - day14
Niuke real problem programming - Day11