服务器上的 pcs 状态错误 httpd_monitor_5000“未运行”(7):

服务器上的 pcs 状态错误 httpd_monitor_5000“未运行”(7):

错误信息

Failed actions:
    httpd_monitor_5000 on abc-zabserver-b 'not running' (7): call=65,  status=complete, last-rc-change='Wed Jul 15 21:44:43 2015', queued=0ms, exec=8ms

电脑状态

[root@abc-zabserver-b ~]# pcs status
Cluster name: abc-zabvip
Last updated: Wed Jul 15 21:50:52 2015
Last change: Wed Jul 15 20:38:07 2015
Stack: cman
Current DC: abc-zabserver-b - partition with quorum
Version: 1.1.11-97629de
2 Nodes configured
3 Resources configured


Online: [ abc-zabserver-a abc-zabserver-b ]

Full list of resources:

Resource Group: zabbix-cluster
     ClusterIP  (ocf::heartbeat:IPaddr2):       Started abc-zabserver-b
     zabbix-server      (lsb:zabbix-server):    Started abc-zabserver-b
     httpd      (lsb:httpd):    Started abc-zabserver-b

Failed actions:
    httpd_monitor_5000 on abc-zabserver-b 'not running' (7): call=65,  status=complete, last-rc-change='Wed Jul 15 21:44:43 2015', queued=0ms, exec=8ms

资源配置

pcs resource create ClusterIP ocf:heartbeat:IPaddr2 ip=10.99.122.69    cidr_netmask=24 op monitor interval=5s
pcs property set stonith-enabled=false
pcs resource create zabbix-server lsb:zabbix-server op monitor interval=5s
pcs resource create httpd lsb:httpd op monitor interval=5s
pcs resource group add zabbix-cluster ClusterIP zabbix-server httpd
pcs property set no-quorum-policy=ignore
pcs property set default-resource-stickiness="100"

pcs 配置显示

[root@abc-zabserver-b ~]# pcs config show
Cluster Name: abc-zabvip
Corosync Nodes:
 abc-zabserver-a abc-zabserver-b
Pacemaker Nodes:
 abc-zabserver-a abc-zabserver-b

Resources:
 Group: zabbix-cluster
  Resource: ClusterIP (class=ocf provider=heartbeat type=IPaddr2)
   Attributes: ip=10.99.122.69 cidr_netmask=24
   Operations: start interval=0s timeout=20s (ClusterIP-start-timeout-20s)
           stop interval=0s timeout=20s (ClusterIP-stop-timeout-20s)
           monitor interval=5s (ClusterIP-monitor-interval-5s)
  Resource: zabbix-server (class=lsb type=zabbix-server)
   Operations: monitor interval=5s (zabbix-server-monitor-interval-5s)
  Resource: httpd (class=lsb type=httpd)
   Operations: monitor interval=5s (httpd-monitor-interval-5s)

Stonith Devices:
Fencing Levels:

Location Constraints:
Ordering Constraints:
Colocation Constraints:

Cluster Properties:
 cluster-infrastructure: cman
 dc-version: 1.1.11-97629de
 default-resource-stickiness: 100
 no-quorum-policy: ignore
 stonith-enabled: false

集群配置文件

[root@abc-zabserver-b ~]# cat /etc/cluster/cluster.conf
<cluster config_version="9" name="abc-zabvip">
  <fence_daemon/>
  <clusternodes>
    <clusternode name="abc-zabserver-a" nodeid="1">
      <fence>
        <method name="pcmk-redirect">
          <device name="pcmk" port="abc-zabserver-a"/>
        </method>
      </fence>
    </clusternode>
    <clusternode name="abc-zabserver-b" nodeid="2">
      <fence>
        <method name="pcmk-redirect">
          <device name="pcmk" port="abc-zabserver-b"/>
        </method>
      </fence>
    </clusternode>
  </clusternodes>
  <cman expected_votes="1" port="5405" transport="udpu" two_node="1"/>
  <fencedevices>
    <fencedevice agent="fence_pcmk" name="pcmk"/>
  </fencedevices>
  <rm>
    <failoverdomains/>
    <resources/>
  </rm>
</cluster>

答案1

httpd 资源确实似乎正在运行(根据您显示的 pcs status 输出)。也许在 Pacemaker 监控服务时有某些东西停止了服务,这会引发您在上面看到的错误,并触发恢复。

如果您在日志中(在 DC:“当前 DC:vda-zabserver-b - 具有仲裁的分区”)查找“LogActions”,您应该会看到 Pacemaker 在资源上执行的任何启动/停止/恢复/重新启动/离开操作。

如果是这种情况,您将需要确保除了 Pacemaker 之外没有任何东西在管理这些集群服务;Pacemaker 期望成为唯一启动和停止这些服务的东西。

您可以通过运行以下命令来清除错误:

# pcs resource cleanup httpd

返回代码 7 通常表示当 Pacemaker 检查其状态时该服务未运行。

http://clusterlabs.org/doc/en-US/Pacemaker/1.0/html/Pacemaker_Explained/ap-lsb.html http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html

答案2

我通过取消注释 httpd.conf 中的状态 URL 并以此方式创建资源来修复此问题。不过请确保http://localhost/服务器状态在添加资源之前可以访问

pcs resource create httpd apache configfile="/etc/httpd/conf/httpd.conf" statusurl="http://localhost/server-status" op monitor interval=5s --group zabbix-cluster

相关内容