1.6. LVS — 框​​​​​​​图​​​​​​​


LVS routers use a collection of programs to monitor cluster members and cluster services. 图 1.5 “LVS Components” illustrates how these various programs on both the active and backup LVS routers work together to manage the cluster.
LVS Components

图 1.5. LVS Components

活​​​​​​​跃​​​​​​​和​​​​​​​备​​​​​​​用​​​​​​​ LVS 路​​​​​​​由​​​​​​​器​​​​​​​中​​​​​​​都​​​​​​​会​​​​​​​运​​​​​​​行​​​​​​​ pulse 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​。​​​​​​​在​​​​​​​备​​​​​​​用​​​​​​​路​​​​​​​由​​​​​​​器​​​​​​​中​​​​​​​,pulse 向​​​​​​​活​​​​​​​跃​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​的​​​​​​​公​​​​​​​共​​​​​​​接​​​​​​​口​​​​​​​发​​​​​​​送​​​​​​​一​​​​​​​个​​​​​​​ heartbeat 来​​​​​​​确​​​​​​​定​​​​​​​活​​​​​​​跃​​​​​​​路​​​​​​​由​​​​​​​器​​​​​​​仍​​​​​​​可​​​​​​​正​​​​​​​常​​​​​​​工​​​​​​​作​​​​​​​。​​​​​​​在​​​​​​​活​​​​​​​跃​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​中​​​​​​​,pulse 启​​​​​​​动​​​​​​​ lvs 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​,并​​​​​​​回​​​​​​​应​​​​​​​来​​​​​​​自​​​​​​​备​​​​​​​用​​​​​​​ LVS 路​​​​​​​由​​​​​​​器​​​​​​​的​​​​​​​ heartbeat 查​​​​​​​询​​​​​​​。​​​​​​​
启​​​​​​​动​​​​​​​后​​​​​​​,lvs 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​调​​​​​​​用​​​​​​​ ipvsadm 程​​​​​​​序​​​​​​​来​​​​​​​配​​​​​​​置​​​​​​​和​​​​​​​维​​​​​​​护​​​​​​​内​​​​​​​核​​​​​​​中​​​​​​​的​​​​​​​ IPVS 路​​​​​​​由​​​​​​​表​​​​​​​,并​​​​​​​为​​​​​​​每​​​​​​​个​​​​​​​真​​​​​​​实​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​中​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​虚​​​​​​​拟​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​启​​​​​​​动​​​​​​​ nanny 进​​​​​​​程​​​​​​​,同​​​​​​​时​​​​​​​告​​​​​​​知​​​​​​​ lvs 该​​​​​​​真​​​​​​​实​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​中​​​​​​​的​​​​​​​服​​​​​​​务​​​​​​​是​​​​​​​否​​​​​​​正​​​​​​​常​​​​​​​工​​​​​​​作​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​发​​​​​​​现​​​​​​​故​​​​​​​障​​​​​​​,lvs 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​会​​​​​​​向​​​​​​​ ipvsadm 发​​​​​​​出​​​​​​​指​​​​​​​令​​​​​​​将​​​​​​​那​​​​​​​个​​​​​​​真​​​​​​​实​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​从​​​​​​​ IPVS 路​​​​​​​由​​​​​​​表​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​。​​​​​​​
如​​​​​​​果​​​​​​​备​​​​​​​用​​​​​​​路​​​​​​​由​​​​​​​器​​​​​​​没​​​​​​​有​​​​​​​收​​​​​​​到​​​​​​​来​​​​​​​自​​​​​​​活​​​​​​​跃​​​​​​​路​​​​​​​由​​​​​​​器​​​​​​​的​​​​​​​响​​​​​​​应​​​​​​​,它​​​​​​​会​​​​​​​通​​​​​​​过​​​​​​​调​​​​​​​用​​​​​​​ send_arp 启​​​​​​​动​​​​​​​失​​​​​​​效​​​​​​​切​​​​​​​换​​​​​​​来​​​​​​​将​​​​​​​所​​​​​​​有​​​​​​​虚​​​​​​​拟​​​​​​​ IP 地​​​​​​​址​​​​​​​重​​​​​​​新​​​​​​​分​​​​​​​配​​​​​​​到​​​​​​​备​​​​​​​用​​​​​​​节​​​​​​​点​​​​​​​的​​​​​​​ NIC 硬​​​​​​​件​​​​​​​地​​​​​​​址​​​​​​​(MAC 地​​​​​​​址​​​​​​​),并​​​​​​​通​​​​​​​过​​​​​​​公​​​​​​​共​​​​​​​和​​​​​​​专​​​​​​​用​​​​​​​网​​​​​​​络​​​​​​​接​​​​​​​口​​​​​​​向​​​​​​​活​​​​​​​跃​​​​​​​路​​​​​​​由​​​​​​​器​​​​​​​发​​​​​​​送​​​​​​​一​​​​​​​个​​​​​​​命​​​​​​​令​​​​​​​来​​​​​​​关​​​​​​​闭​​​​​​​活​​​​​​​跃​​​​​​​路​​​​​​​由​​​​​​​器​​​​​​​中​​​​​​​的​​​​​​​ lvs 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​,启​​​​​​​动​​​​​​​备​​​​​​​用​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​的​​​​​​​ lvs 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​来​​​​​​​为​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​虚​​​​​​​拟​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​接​​​​​​​收​​​​​​​请​​​​​​​求​​​​​​​。​​​​​​​

1.6.1. LVS Components

第 1.6.1.1 节 “pulse shows a detailed list of each software component in an LVS router.

1.6.1.1. pulse

This is the controlling process which starts all other daemons related to LVS routers. At boot time, the daemon is started by the /etc/rc.d/init.d/pulse script. It then reads the configuration file /etc/sysconfig/ha/lvs.cf. On the active router, pulse starts the LVS daemon. On the backup router, pulse determines the health of the active router by executing a simple heartbeat at a user-configurable interval. If the active router fails to respond after a user-configurable interval, it initiates failover. During failover, pulse on the backup router instructs the pulse daemon on the active router to shut down all LVS services, starts the send_arp program to reassign the floating IP addresses to the backup router's MAC address, and starts the lvs daemon.

1.6.1.2. lvs

一​​​​​​​旦​​​​​​​被​​​​​​​ pulse 调​​​​​​​用​​​​​​​,lvs 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​就​​​​​​​运​​​​​​​行​​​​​​​在​​​​​​​活​​​​​​​动​​​​​​​ LVS 路​​​​​​​由​​​​​​​器​​​​​​​中​​​​​​​。​​​​​​​它​​​​​​​读​​​​​​​取​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​ /etc/sysconfig/ha/lvs.cf,调​​​​​​​用​​​​​​​ ipvsadm 工​​​​​​​具​​​​​​​来​​​​​​​构​​​​​​​建​​​​​​​和​​​​​​​维​​​​​​​护​​​​​​​ IPVS 路​​​​​​​由​​​​​​​表​​​​​​​,并​​​​​​​为​​​​​​​每​​​​​​​个​​​​​​​配​​​​​​​置​​​​​​​的​​​​​​​ LVS 服​​​​​​​务​​​​​​​分​​​​​​​配​​​​​​​ nanny 进​​​​​​​程​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​ nanny 报​​​​​​​告​​​​​​​某​​​​​​​个​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​关​​​​​​​闭​​​​​​​了​​​​​​​,lvs 将​​​​​​​指​​​​​​​引​​​​​​​ ipvsadm 工​​​​​​​具​​​​​​​从​​​​​​​ IPVS 路​​​​​​​由​​​​​​​表​​​​​​​中​​​​​​​删​​​​​​​除​​​​​​​这​​​​​​​个​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​。​​​​​​​

1.6.1.3. ipvsadm

这​​​​​​​个​​​​​​​服​​​​​​​务​​​​​​​更​​​​​​​新​​​​​​​内​​​​​​​核​​​​​​​中​​​​​​​的​​​​​​​ IPVS 路​​​​​​​由​​​​​​​表​​​​​​​。​​​​​​​lvs 守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​通​​​​​​​过​​​​​​​调​​​​​​​用​​​​​​​ ipvsadm 来​​​​​​​添​​​​​​​加​​​​​​​、​​​​​​​修​​​​​​​改​​​​​​​或​​​​​​​者​​​​​​​删​​​​​​​除​​​​​​​ IPVS 路​​​​​​​由​​​​​​​表​​​​​​​中​​​​​​​的​​​​​​​条​​​​​​​目​​​​​​​来​​​​​​​设​​​​​​​置​​​​​​​和​​​​​​​管​​​​​​​理​​​​​​​ LVS。​​​​​​​

1.6.1.4. nanny

nanny 监​​​​​​​控​​​​​​​运​​​​​​​行​​​​​​​在​​​​​​​活​​​​​​​跃​​​​​​​ LVS 路​​​​​​​由​​​​​​​器​​​​​​​中​​​​​​​的​​​​​​​守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​。​​​​​​​通​​​​​​​过​​​​​​​这​​​​​​​个​​​​​​​守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​,活​​​​​​​跃​​​​​​​路​​​​​​​由​​​​​​​器​​​​​​​可​​​​​​​确​​​​​​​定​​​​​​​每​​​​​​​个​​​​​​​真​​​​​​​实​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​的​​​​​​​状​​​​​​​态​​​​​​​,有​​​​​​​时​​​​​​​还​​​​​​​可​​​​​​​以​​​​​​​监​​​​​​​控​​​​​​​其​​​​​​​工​​​​​​​作​​​​​​​负​​​​​​​载​​​​​​​。​​​​​​​每​​​​​​​个​​​​​​​真​​​​​​​实​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​中​​​​​​​定​​​​​​​义​​​​​​​的​​​​​​​每​​​​​​​个​​​​​​​服​​​​​​​务​​​​​​​都​​​​​​​有​​​​​​​一​​​​​​​个​​​​​​​独​​​​​​​立​​​​​​​进​​​​​​​程​​​​​​​为​​​​​​​其​​​​​​​运​​​​​​​行​​​​​​​。​​​​​​​

1.6.1.5. /etc/sysconfig/ha/lvs.cf

这​​​​​​​是​​​​​​​ LVS 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​。​​​​​​​所​​​​​​​有​​​​​​​守​​​​​​​护​​​​​​​进​​​​​​​程​​​​​​​都​​​​​​​直​​​​​​​接​​​​​​​或​​​​​​​者​​​​​​​间​​​​​​​接​​​​​​​地​​​​​​​从​​​​​​​这​​​​​​​个​​​​​​​文​​​​​​​件​​​​​​​中​​​​​​​获​​​​​​​得​​​​​​​它​​​​​​​们​​​​​​​的​​​​​​​配​​​​​​​置​​​​​​​信​​​​​​​息​​​​​​​。​​​​​​​

1.6.1.6. Piranha Configuration Tool

这​​​​​​​是​​​​​​​用​​​​​​​来​​​​​​​监​​​​​​​控​​​​​​​、​​​​​​​配​​​​​​​置​​​​​​​和​​​​​​​管​​​​​​​理​​​​​​​ LVS 的​​​​​​​网​​​​​​​页​​​​​​​工​​​​​​​具​​​​​​​。​​​​​​​它​​​​​​​是​​​​​​​用​​​​​​​来​​​​​​​维​​​​​​​护​​​​​​​ /etc/sysconfig/ha/lvs.cf LVS 配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​的​​​​​​​默​​​​​​​认​​​​​​​工​​​​​​​具​​​​​​​。​​​​​​​

1.6.1.7. send_arp

在​​​​​​​失​​​​​​​效​​​​​​​切​​​​​​​换​​​​​​​过​​​​​​​程​​​​​​​中​​​​​​​,当​​​​​​​浮​​​​​​​动​​​​​​​ IP 地​​​​​​​址​​​​​​​在​​​​​​​节​​​​​​​点​​​​​​​间​​​​​​​进​​​​​​​行​​​​​​​更​​​​​​​改​​​​​​​时​​​​​​​,这​​​​​​​个​​​​​​​程​​​​​​​序​​​​​​​发​​​​​​​送​​​​​​​ ARP 广​​​​​​​播​​​​​​​。​​​​​​​
第 2 章 初​​​​​​​始​​​​​​​ LVS 配​​​​​​​置​​​​​​​ reviews important post-installation configuration steps you should take before configuring Red Hat Enterprise Linux to be an LVS router.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.