Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

第 2 章 初​​​​​​​始​​​​​​​ LVS 配​​​​​​​置​​​​​​​

安​​​​​​​装​​​​​​​Red Hat Enterprise Linux 后​​​​​​​,您​​​​​​​必​​​​​​​须​​​​​​​执​​​​​​​行​​​​​​​一​​​​​​​些​​​​​​​基​​​​​​​本​​​​​​​操​​​​​​​作​​​​​​​步​​​​​​​骤​​​​​​​来​​​​​​​设​​​​​​​置​​​​​​​ LVS 路​​​​​​​由​​​​​​​器​​​​​​​和​​​​​​​真​​​​​​​实​​​​​​​服​​​​​​​务​​​​​​​器​​​​​​​(real server)。​​​​​​​本​​​​​​​章​​​​​​​对​​​​​​​这​​​​​​​些​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​步​​​​​​​骤​​​​​​​进​​​​​​​行​​​​​​​了​​​​​​​详​​​​​​​细​​​​​​​的​​​​​​​论​​​​​​​述​​​​​​​。​​​​​​​

注意

当​​​​​​​启​​​​​​​动​​​​​​​群​​​​​​​集​​​​​​​后​​​​​​​,LVS 路​​​​​​​由​​​​​​​器​​​​​​​节​​​​​​​点​​​​​​​就​​​​​​​成​​​​​​​为​​​​​​​活​​​​​​​跃​​​​​​​节​​​​​​​点​​​​​​​,也​​​​​​​叫​​​​​​​主​​​​​​​节​​​​​​​点​​​​​​​。​​​​​​​在​​​​​​​配​​​​​​​置​​​​​​​ LVS 时​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​主​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​的​​​​​​​ Piranha Configuration Tool。​​​​​​​

2.1. 在​​​​​​​ LVS 路​​​​​​​由​​​​​​​器​​​​​​​中​​​​​​​配​​​​​​​置​​​​​​​服​​​​​​​务​​​​​​​

Red Hat Enterprise Linux 安​​​​​​​装​​​​​​​程​​​​​​​序​​​​​​​会​​​​​​​安​​​​​​​装​​​​​​​所​​​​​​​有​​​​​​​设​​​​​​​置​​​​​​​ LVS 所​​​​​​​需​​​​​​​要​​​​​​​的​​​​​​​组​​​​​​​件​​​​​​​,但​​​​​​​必​​​​​​​须​​​​​​​在​​​​​​​配​​​​​​​置​​​​​​​群​​​​​​​集​​​​​​​前​​​​​​​激​​​​​​​活​​​​​​​正​​​​​​​确​​​​​​​的​​​​​​​服​​​​​​​务​​​​​​​。​​​​​​​请​​​​​​​为​​​​​​​两​​​​​​​个​​​​​​​ LVS 路​​​​​​​由​​​​​​​器​​​​​​​在​​​​​​​引​​​​​​​导​​​​​​​时​​​​​​​启​​​​​​​动​​​​​​​正​​​​​​​确​​​​​​​的​​​​​​​服​​​​​​​务​​​​​​​。​​​​​​​Red Hat Enterprise Linux 中​​​​​​​有​​​​​​​三​​​​​​​个​​​​​​​主​​​​​​​要​​​​​​​的​​​​​​​工​​​​​​​具​​​​​​​可​​​​​​​用​​​​​​​来​​​​​​​将​​​​​​​服​​​​​​​务​​​​​​​设​​​​​​​置​​​​​​​为​​​​​​​在​​​​​​​引​​​​​​​导​​​​​​​时​​​​​​​激​​​​​​​活​​​​​​​,它​​​​​​​们​​​​​​​是​​​​​​​命​​​​​​​令​​​​​​​行​​​​​​​程​​​​​​​序​​​​​​​chkconfig、​​​​​​​ncurses-based 程​​​​​​​序​​​​​​​ ntsysv 和​​​​​​​图​​​​​​​形​​​​​​​界​​​​​​​面​​​​​​​程​​​​​​​序​​​​​​​ Services Configuration Tool。​​​​​​​这​​​​​​​些​​​​​​​工​​​​​​​具​​​​​​​都​​​​​​​要​​​​​​​求​​​​​​​有​​​​​​​根​​​​​​​访​​​​​​​问​​​​​​​才​​​​​​​可​​​​​​​以​​​​​​​使​​​​​​​用​​​​​​​。​​​​​​​

注意

要​​​​​​​获​​​​​​​得​​​​​​​根​​​​​​​访​​​​​​​问​​​​​​​权​​​​​​​限​​​​​​​,请​​​​​​​在​​​​​​​ shell 提​​​​​​​示​​​​​​​符​​​​​​​后​​​​​​​输​​​​​​​入​​​​​​​ su - 命​​​​​​​令​​​​​​​和​​​​​​​根​​​​​​​密​​​​​​​码​​​​​​​。​​​​​​​例​​​​​​​如​​​​​​​:
$ su - root password
在​​​​​​​ LVS 路​​​​​​​由​​​​​​​器​​​​​​​中​​​​​​​,需​​​​​​​要​​​​​​​将​​​​​​​三​​​​​​​个​​​​​​​服​​​​​​​务​​​​​​​设​​​​​​​置​​​​​​​为​​​​​​​在​​​​​​​引​​​​​​​导​​​​​​​时​​​​​​​激​​​​​​​活​​​​​​​:
  • piranha-gui 服​​​​​​​务​​​​​​​(只​​​​​​​用​​​​​​​于​​​​​​​主​​​​​​​节​​​​​​​点​​​​​​​)
  • pulse 服​​​​​​​务​​​​​​​
  • sshd 服​​​​​​​务​​​​​​​
如​​​​​​​果​​​​​​​您​​​​​​​正​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​多​​​​​​​端​​​​​​​口​​​​​​​服​​​​​​​务​​​​​​​或​​​​​​​者​​​​​​​正​​​​​​​在​​​​​​​使​​​​​​​用​​​​​​​防​​​​​​​火​​​​​​​墙​​​​​​​标​​​​​​​记​​​​​​​,您​​​​​​​还​​​​​​​必​​​​​​​须​​​​​​​启​​​​​​​用​​​​​​​ iptables 服​​​​​​​务​​​​​​​。​​​​​​​
最​​​​​​​好​​​​​​​是​​​​​​​将​​​​​​​这​​​​​​​些​​​​​​​服​​​​​​​务​​​​​​​设​​​​​​​置​​​​​​​为​​​​​​​在​​​​​​​运​​​​​​​行​​​​​​​级​​​​​​​别​​​​​​​ 3 和​​​​​​​运​​​​​​​行​​​​​​​级​​​​​​​别​​​​​​​ 5 都​​​​​​​激​​​​​​​活​​​​​​​。​​​​​​​要​​​​​​​达​​​​​​​到​​​​​​​此​​​​​​​目​​​​​​​的​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​ chkconfig,并​​​​​​​为​​​​​​​每​​​​​​​个​​​​​​​服​​​​​​​务​​​​​​​输​​​​​​​入​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​:
/sbin/chkconfig --level 35 daemon on
在​​​​​​​上​​​​​​​面​​​​​​​的​​​​​​​命​​​​​​​令​​​​​​​中​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​您​​​​​​​想​​​​​​​要​​​​​​​激​​​​​​​活​​​​​​​的​​​​​​​服​​​​​​​务​​​​​​​名​​​​​​​称​​​​​​​替​​​​​​​换​​​​​​​ daemon。​​​​​​​要​​​​​​​获​​​​​​​得​​​​​​​系​​​​​​​统​​​​​​​中​​​​​​​的​​​​​​​服​​​​​​​务​​​​​​​及​​​​​​​在​​​​​​​什​​​​​​​么​​​​​​​运​​​​​​​行​​​​​​​级​​​​​​​别​​​​​​​将​​​​​​​其​​​​​​​设​​​​​​​定​​​​​​​为​​​​​​​激​​​​​​​活​​​​​​​的​​​​​​​列​​​​​​​表​​​​​​​,请​​​​​​​使​​​​​​​用​​​​​​​以​​​​​​​下​​​​​​​命​​​​​​​令​​​​​​​:
/sbin/chkconfig --list

警告

Turning any of the above services on using chkconfig does not actually start the daemon. To do this use the /sbin/service command. See 第 2.3 节 “启​​​​​​​动​​​​​​​ Piranha Configuration Tool服​​​​​​​务​​​​​​​” for an example of how to use the /sbin/service command.
For more information on runlevels and configuring services with ntsysv and the Services Configuration Tool, refer to the chapter titled "Controlling Access to Services" in the Red Hat Enterprise Linux System Administration Guide.