我們有兩臺帶有Pacemaker(crm)設置的服務器,可啓用主/備用羣集。目前有兩種服務由Pacemaker控制/監控,如果發生故障,將導致故障切換到備用服務器,我們自己的定製服務(以下稱爲customservice1)和mysql。如何使用Pacemaker重新啓動httpd
customservice1和mysql在備用服務器上停止並且在主服務器上運行(顯然)。當故障轉移發生時,看起來心臟起搏器會停止這兩種情況(或者如果只有一個人出於任何原因失敗,我不太清楚這一點,確保他們停止),更改主要和備用的IP地址(以便DNS中的別名將始終轉到主服務器上),然後在之前的備用服務器上啓動customservice1和mysql。
我想添加一個步驟,由pacemaker控制,只需在發生故障轉移時重新啓動httpd。目前httpd一直在主服務器和備用服務器上運行。目前,httpd中的故障不會導致故障轉移,我對增加監控並不感興趣,我只是想讓起搏器在使備用服務器成爲主服務器時運行相當於'service httpd restart'的服務。
添加只能重新啓動服務的新基元的正確語法是什麼?
目前起搏器配置如下:
node $id="XX" some.machine.name \
attributes standby="off"
node $id="YY" another.machine.name
primitive customservice1 lsb:customservice1 \
op monitor interval="30s" timeout="30s" \
op start interval="0" timeout="120" \
op stop interval="0" timeout="120" \
meta target-role="Started"
primitive mysql-server ocf:heartbeat:mysql \
params binary="/usr/bin/mysqld_safe" config="/etc/my.cnf" datadir="/some/data/dir" user="mysql" pid="/var/lib/mysql/mysql.pid" socket="/var/lib/mysql/mysql.sock" \
op monitor interval="30s" timeout="30s" \
op start interval="0" timeout="120" \
op stop interval="0" timeout="120"
primitive node1-stonith stonith:external/riloe \
params hostlist="some.machine.name" ilo_user="Administrator" ilo_hostname="some-ilo.machine.name" ilo_password="<ilopassword>" ilo_can_reset="1" ilo_protocol="2.0" ilo_powerdown_method="button" \
op monitor interval="120s" timeout="40s" \
meta target-role="Started"
primitive node2-stonith stonith:external/riloe \
params hostlist="another.machine.name" ilo_user="Administrator" ilo_hostname="another-ilo.machine.name" ilo_password="<ilopassword>" ilo_can_reset="1" ilo_protocol="2.0" ilo_powerdown_method="button" \
op monitor interval="120s" timeout="40s" \
meta target-role="Started"
primitive node_one_ip ocf:heartbeat:IPaddr2 \
params ip="1.1.1.1" cidr_netmask="255.255.255.0" nic="eth0" \
op monitor interval="40s" timeout="20s"
primitive node_two_ip ocf:heartbeat:IPaddr2 \
params ip="1.1.1.2" cidr_netmask="255.255.255.0" nic="eth0" \
op monitor interval="40s" timeout="20s" \
meta target-role="Started"
group only-group node_one_ip mysql-server customservice1
property $id="cib-bootstrap-options" \
dc-version="1.0.9-89bd754939df5150de7cd76835f98fe90851b677" \
cluster-infrastructure="Heartbeat" \
no-quorum-policy="ignore" \
last-lrm-refresh="1287686604" \
default-resource-stickiness="1"
「將http服務器置於Pacemaker的控制下」是否意味着不僅僅是爲它添加原語?假設不,我可以讓我的新原型成爲現有團隊的成員嗎?關於httpd與其他團隊成員之間並沒有什麼需要尊重的順序,但我可能只是先做出來。 – twilbrand