プライマリ/スタンバイクラスタを有効にするPacemaker(crm)設定の2台のサーバーがあります。 Pacemakerが現在管理している2つのサービスは、どちらかがダウンすると、スタンバイ、独自のカスタムサービス(以下customservice1)、およびmysqlへのフェールオーバーが発生します。Pacemakerを使用してhttpdを再起動する方法
customservice1とmysqlはスタンバイで停止し、プライマリ(明らかに)で実行されます。フェールオーバーが発生すると、ペースメーカは両方を停止するように見えます(または、何らかの理由で障害が発生した場合は停止していることを確認します)、プライマリとスタンバイのIPアドレスを変更しますDNSのエイリアスは常にプライマリに移動します)、以前にスタンバイだったものでcustomservice1とmysqlを起動します。
フェールオーバーが発生するたびに、単にhttpdを再起動する、これにペースメーカーによって制御されるステップを追加したいと思います。現在、httpdは常にプライマリとスタンバイの両方で動作しています。現在のところ、httpdの障害はフェイルオーバを引き起こすものではなく、私はその監視を追加することに本当に関心がありません。単に、スタンバイをプライマリにするときに、pacemakerに '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