1.4. 高​​​​​​​可​​​​​​​用​​​​​​​性​​​​​​​服​​​​​​​务​​​​​​​管​​​​​​​理​​​​​​​

高​​​​​​​可​​​​​​​用​​​​​​​性​​​​​​​服​​​​​​​务​​​​​​​管​​​​​​​理​​​​​​​提​​​​​​​供​​​​​​​在​​​​​​​ Red Hat 群​​​​​​​集​​​​​​​中​​​​​​​创​​​​​​​建​​​​​​​和​​​​​​​管​​​​​​​理​​​​​​​高​​​​​​​可​​​​​​​用​​​​​​​性​​​​​​​群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​(cluster service)的​​​​​​​能​​​​​​​力​​​​​​​。​​​​​​​Red Hat 群​​​​​​​集​​​​​​​里​​​​​​​的​​​​​​​高​​​​​​​可​​​​​​​用​​​​​​​性​​​​​​​服​​​​​​​务​​​​​​​管​​​​​​​理​​​​​​​的​​​​​​​关​​​​​​​键​​​​​​​组​​​​​​​件​​​​​​​是​​​​​​​ rgmanager,它​​​​​​​实​​​​​​​现​​​​​​​了​​​​​​​ off-the-shelf 应​​​​​​​用​​​​​​​程​​​​​​​序​​​​​​​的​​​​​​​冷​​​​​​​失​​​​​​​效​​​​​​​切​​​​​​​换​​​​​​​(cold failover)。​​​​​​​在​​​​​​​ Red Hat 群​​​​​​​集​​​​​​​里​​​​​​​,应​​​​​​​用​​​​​​​程​​​​​​​序​​​​​​​和​​​​​​​其​​​​​​​他​​​​​​​群​​​​​​​集​​​​​​​资​​​​​​​源​​​​​​​进​​​​​​​行​​​​​​​配​​​​​​​置​​​​​​​来​​​​​​​组​​​​​​​成​​​​​​​高​​​​​​​可​​​​​​​用​​​​​​​性​​​​​​​的​​​​​​​群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​。​​​​​​​高​​​​​​​可​​​​​​​用​​​​​​​性​​​​​​​群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​可​​​​​​​以​​​​​​​从​​​​​​​一​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​到​​​​​​​另​​​​​​​外​​​​​​​一​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​,而​​​​​​​不​​​​​​​会​​​​​​​对​​​​​​​群​​​​​​​集​​​​​​​客​​​​​​​户​​​​​​​有​​​​​​​明​​​​​​​显​​​​​​​的​​​​​​​影​​​​​​​响​​​​​​​。​​​​​​​当​​​​​​​某​​​​​​​个​​​​​​​群​​​​​​​集​​​​​​​节​​​​​​​点​​​​​​​发​​​​​​​生​​​​​​​故​​​​​​​障​​​​​​​或​​​​​​​群​​​​​​​集​​​​​​​系​​​​​​​统​​​​​​​管​​​​​​​理​​​​​​​员​​​​​​​将​​​​​​​服​​​​​​​务​​​​​​​迁​​​​​​​移​​​​​​​(例​​​​​​​如​​​​​​​,需​​​​​​​要​​​​​​​对​​​​​​​这​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​进​​​​​​​行​​​​​​​预​​​​​​​定​​​​​​​的​​​​​​​维​​​​​​​护​​​​​​​时​​​​​​​)到​​​​​​​另​​​​​​​外​​​​​​​一​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​时​​​​​​​,群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​的​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​都​​​​​​​可​​​​​​​以​​​​​​​发​​​​​​​生​​​​​​​。​​​​​​​
要​​​​​​​创​​​​​​​建​​​​​​​高​​​​​​​可​​​​​​​用​​​​​​​性​​​​​​​服​​​​​​​务​​​​​​​,您​​​​​​​必​​​​​​​须​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​里​​​​​​​进​​​​​​​行​​​​​​​配​​​​​​​置​​​​​​​。​​​​​​​群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​由​​​​​​​群​​​​​​​集​​​​​​​资​​​​​​​源​​​​​​​组​​​​​​​成​​​​​​​。​​​​​​​群​​​​​​​集​​​​​​​资​​​​​​​源​​​​​​​是​​​​​​​您​​​​​​​在​​​​​​​群​​​​​​​集​​​​​​​配​​​​​​​置​​​​​​​文​​​​​​​件​​​​​​​里​​​​​​​创​​​​​​​建​​​​​​​和​​​​​​​管​​​​​​​理​​​​​​​的​​​​​​​构​​​​​​​建​​​​​​​块​​​​​​​(building block) — 例​​​​​​​如​​​​​​​,IP 地​​​​​​​址​​​​​​​、​​​​​​​应​​​​​​​用​​​​​​​程​​​​​​​序​​​​​​​初​​​​​​​始​​​​​​​化​​​​​​​脚​​​​​​​本​​​​​​​或​​​​​​​者​​​​​​​ Red Hat GFS 共​​​​​​​享​​​​​​​分​​​​​​​区​​​​​​​。​​​​​​​
You can associate a cluster service with a failover domain. A failover domain is a subset of cluster nodes that are eligible to run a particular cluster service (refer to 图 1.9 “故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​域​​​​​​​”).

注意

故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​域​​​​​​​不​​​​​​​是​​​​​​​必​​​​​​​需​​​​​​​的​​​​​​​。​​​​​​​
群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​在​​​​​​​某​​​​​​​个​​​​​​​时​​​​​​​间​​​​​​​只​​​​​​​能​​​​​​​在​​​​​​​一​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​运​​​​​​​行​​​​​​​,这​​​​​​​样​​​​​​​可​​​​​​​以​​​​​​​维​​​​​​​护​​​​​​​数​​​​​​​据​​​​​​​的​​​​​​​完​​​​​​​整​​​​​​​性​​​​​​​。​​​​​​​您​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​故​​​​​​​障​​​​​​​效​​​​​​​切​​​​​​​换​​​​​​​域​​​​​​​里​​​​​​​指​​​​​​​定​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​的​​​​​​​优​​​​​​​先​​​​​​​级​​​​​​​。​​​​​​​指​​​​​​​定​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​的​​​​​​​优​​​​​​​先​​​​​​​级​​​​​​​是​​​​​​​通​​​​​​​过​​​​​​​为​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​域​​​​​​​里​​​​​​​的​​​​​​​每​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​分​​​​​​​配​​​​​​​优​​​​​​​先​​​​​​​级​​​​​​​别​​​​​​​实​​​​​​​现​​​​​​​的​​​​​​​。​​​​​​​优​​​​​​​先​​​​​​​级​​​​​​​决​​​​​​​定​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​的​​​​​​​顺​​​​​​​序​​​​​​​ — 决​​​​​​​定​​​​​​​群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​应​​​​​​​该​​​​​​​切​​​​​​​换​​​​​​​到​​​​​​​哪​​​​​​​个​​​​​​​节​​​​​​​点​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​您​​​​​​​没​​​​​​​有​​​​​​​指​​​​​​​定​​​​​​​优​​​​​​​先​​​​​​​级​​​​​​​,群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​将​​​​​​​可​​​​​​​能​​​​​​​切​​​​​​​换​​​​​​​至​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​域​​​​​​​里​​​​​​​的​​​​​​​任​​​​​​​意​​​​​​​节​​​​​​​点​​​​​​​。​​​​​​​而​​​​​​​且​​​​​​​,您​​​​​​​可​​​​​​​以​​​​​​​指​​​​​​​定​​​​​​​是​​​​​​​否​​​​​​​限​​​​​​​制​​​​​​​群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​在​​​​​​​其​​​​​​​相​​​​​​​关​​​​​​​的​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​域​​​​​​​里​​​​​​​的​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​运​​​​​​​行​​​​​​​。​​​​​​​(如​​​​​​​果​​​​​​​与​​​​​​​非​​​​​​​限​​​​​​​制​​​​​​​性​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​域​​​​​​​相​​​​​​​关​​​​​​​联​​​​​​​,在​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​域​​​​​​​里​​​​​​​的​​​​​​​成​​​​​​​员​​​​​​​都​​​​​​​不​​​​​​​可​​​​​​​用​​​​​​​的​​​​​​​时​​​​​​​候​​​​​​​,群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​可​​​​​​​以​​​​​​​在​​​​​​​任​​​​​​​意​​​​​​​节​​​​​​​点​​​​​​​中​​​​​​​启​​​​​​​动​​​​​​​。​​​​​​​)
In 图 1.9 “故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​域​​​​​​​”, Failover Domain 1 is configured to restrict failover within that domain; therefore, Cluster Service X can only fail over between Node A and Node B. Failover Domain 2 is also configured to restrict failover with its domain; additionally, it is configured for failover priority. Failover Domain 2 priority is configured with Node C as priority 1, Node B as priority 2, and Node D as priority 3. If Node C fails, Cluster Service Y fails over to Node B next. If it cannot fail over to Node B, it tries failing over to Node D. Failover Domain 3 is configured with no priority and no restrictions. If the node that Cluster Service Z is running on fails, Cluster Service Z tries failing over to one of the nodes in Failover Domain 3. However, if none of those nodes is available, Cluster Service Z can fail over to any node in the cluster.
故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​域​​​​​​​

图 1.9. 故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​域​​​​​​​

图 1.10 “Web Server Cluster Service Example” shows an example of a high-availability cluster service that is a web server named "content-webserver". It is running in cluster node B and is in a failover domain that consists of nodes A, B, and D. In addition, the failover domain is configured with a failover priority to fail over to node D before node A and to restrict failover to nodes only in that failover domain. The cluster service comprises these cluster resources:
  • IP 地​​​​​​​址​​​​​​​资​​​​​​​源​​​​​​​ — 10.10.10.201。​​​​​​​
  • An application resource named "httpd-content" — a web server application init script /etc/init.d/httpd (specifying httpd).
  • A file system resource — Red Hat GFS named "gfs-content-webserver".
Web Server Cluster Service Example

图 1.10. Web Server Cluster Service Example

客​​​​​​​户​​​​​​​通​​​​​​​过​​​​​​​ IP 地​​​​​​​址​​​​​​​ 10.10.10.201 访​​​​​​​问​​​​​​​群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​,和​​​​​​​ web 服​​​​​​​务​​​​​​​器​​​​​​​应​​​​​​​用​​​​​​​程​​​​​​​序​​​​​​​ httpd-content 进​​​​​​​行​​​​​​​交​​​​​​​互​​​​​​​。​​​​​​​httpd-content 使​​​​​​​用​​​​​​​ gfs-content-webserver 文​​​​​​​件​​​​​​​系​​​​​​​统​​​​​​​。​​​​​​​如​​​​​​​果​​​​​​​节​​​​​​​点​​​​​​​ B 发​​​​​​​生​​​​​​​故​​​​​​​障​​​​​​​,content-webserver 群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​将​​​​​​​切​​​​​​​换​​​​​​​到​​​​​​​节​​​​​​​点​​​​​​​ D。​​​​​​​如​​​​​​​果​​​​​​​节​​​​​​​点​​​​​​​ D 不​​​​​​​可​​​​​​​用​​​​​​​或​​​​​​​者​​​​​​​也​​​​​​​发​​​​​​​生​​​​​​​了​​​​​​​故​​​​​​​障​​​​​​​,服​​​​​​​务​​​​​​​将​​​​​​​切​​​​​​​换​​​​​​​至​​​​​​​节​​​​​​​点​​​​​​​ A。​​​​​​​故​​​​​​​障​​​​​​​切​​​​​​​换​​​​​​​将​​​​​​​对​​​​​​​群​​​​​​​集​​​​​​​客​​​​​​​户​​​​​​​不​​​​​​​产​​​​​​​生​​​​​​​明​​​​​​​显​​​​​​​的​​​​​​​影​​​​​​​响​​​​​​​。​​​​​​​和​​​​​​​切​​​​​​​换​​​​​​​前​​​​​​​一​​​​​​​样​​​​​​​,群​​​​​​​集​​​​​​​服​​​​​​​务​​​​​​​将​​​​​​​可​​​​​​​以​​​​​​​用​​​​​​​相​​​​​​​同​​​​​​​的​​​​​​​ IP 地​​​​​​​址​​​​​​​从​​​​​​​另​​​​​​​外​​​​​​​一​​​​​​​个​​​​​​​群​​​​​​​集​​​​​​​节​​​​​​​点​​​​​​​进​​​​​​​行​​​​​​​访​​​​​​​问​​​​​​​。​​​​​​​