1

My first time setting up pcs. I have two CentOS 7 VM's on which I installed pcs and Pacemaker. I defined a virtual IP and Apache HTTP cluster.

The two VM's have IP's 192.168.56.121 and 192.168.56.122. The VIP is configured for 192.168.56.199. I can ping the VIP and can open the test index.html on the VIP.

As per another post here, I have stopped and disabled httpd.service as pcs manages its operations. firewalld is disabled as is SELinux.

I have two issues: Firstly, my index.html on the two nodes is a single line of text saying "Node 1" and "Node 2". Refreshingly the page multiple times, I see that only the node 1 file is served unless I stop that node, in which case the file from node 2 is served. This indicates that the nodes are working as active-standby. Any way to make it a load-balancer with both nodes serving alternate requests?

Secondly, the pcs status shows that the resources are in stopped state, even though ping and http are working.

Here is what pcs status shows:

Cluster name: mycluster
Stack: corosync
Current DC: db21 (version 1.1.23-1.el7_9.1-9acf116022) - partition with quorum
Last updated: Tue Jan  5 15:47:00 2021
Last change: Tue Jan  5 11:28:04 2021 by root via cibadmin on db21

2 nodes configured
2 resource instances configured

Online: [ db21 db22 ]

Full list of resources:

 Resource Group: webgroup
     apache_res (ocf::heartbeat:apache):        Stopped
     vip_res    (ocf::heartbeat:IPaddr2):       Stopped

Failed Resource Actions:
* apache_res_start_0 on db21 'unknown error' (1): call=10, status=Timed Out, exitreason='',
    last-rc-change='Tue Jan  5 11:32:43 2021', queued=1ms, exec=40019ms
* apache_res_start_0 on db22 'unknown error' (1): call=10, status=Timed Out, exitreason='',
    last-rc-change='Tue Jan  5 11:33:24 2021', queued=0ms, exec=40021ms

Daemon Status:
  corosync: active/enabled
  pacemaker: active/enabled
  pcsd: active/enabled

Output of pcs config show:

Cluster Name: mycluster
Corosync Nodes:
 db21 db22
Pacemaker Nodes:
 db21 db22

Resources:
 Group: webgroup
  Resource: apache_res (class=ocf provider=heartbeat type=apache)
   Attributes: configfile=/etc/httpd/conf/httpd.conf statusurl=http://127.0.0.1/server-status
   Operations: monitor interval=10s timeout=20s (apache_res-monitor-interval-10s)
               start interval=0s timeout=40s (apache_res-start-interval-0s)
               stop interval=0s timeout=60s (apache_res-stop-interval-0s)
  Resource: vip_res (class=ocf provider=heartbeat type=IPaddr2)
   Attributes: cidr_netmask=24 ip=192.168.56.199
   Operations: monitor interval=10s timeout=20s (vip_res-monitor-interval-10s)
               start interval=0s timeout=20s (vip_res-start-interval-0s)
               stop interval=0s timeout=20s (vip_res-stop-interval-0s)

Stonith Devices:
Fencing Levels:

Location Constraints:
Ordering Constraints:
Colocation Constraints:
Ticket Constraints:

Alerts:
 No alerts defined

Resources Defaults:
 No defaults set
Operations Defaults:
 No defaults set

Cluster Properties:
 cluster-infrastructure: corosync
 cluster-name: mycluster
 dc-version: 1.1.23-1.el7_9.1-9acf116022
 have-watchdog: false
 stonith-enabled: false

Quorum:
  Options:

Which log file or command would show why the status is being shown as stopped?

Hussain Akbar
  • 141
  • 1
  • 4

0 Answers0