I'm trying to replace a single aging load balancer with multiple virtual machines running nginx. However after I got centos 7 and nginx installed I realized that heartbeat has been deprecated. So I started looking at corosync and pcs to setup and manage a HA cluster.

I setup the nodes in the cluster and added a resource for a virtual ip for each webapp that I wish to use. The problems become apparent when I check the status

[root@vlb1 nginx]# pcs status
Cluster name: webapps
Last updated: Thu Mar  5 21:27:03 2015
Last change: Thu Mar  5 16:43:22 2015 via cibadmin on vlb1.domain.com
Stack: corosync
Current DC: vlb2.domain.com (2) - partition with quorum
Version: 1.1.10-32.el7_0.1-368c726
2 Nodes configured
2 Resources configured

Online: [ vlb1.domain.com vlb2.domain.com ]

Full list of resources:

 webapp1_cluster    (ocf::heartbeat:IPaddr2):   Started vlb2.domain.com 
 webapp2_cluster    (ocf::heartbeat:IPaddr2):   Started vlb1.domain.com 

PCSD Status:
  vlb1.domain.com: Online
  vlb2.domain.com: Online

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

Immediately I can see that I have resource clusters going to different nodes. The bigger problem is that without corosync controlling nginx, vlb1 might be working while vlb2 will be giving a cannot bind address error i.e.

015/03/05 21:15:51 [emerg] 985#0: bind() to failed (99: Cannot assign requested address)

At this point I have two questions:

  1. Is it possible to have the HA cluster control starting (on the new node) and stopping (on the old node) nginx when a failover occurs?

  2. Is it possible to have multiple cluster resources and have them all goign to the current node, or should I route multiple webapps to a single virtual ip and handle it in the server declaration in nginx?

We had originally separated each unique webapp into it's own cluster for PCI Compliance reasons and I'd prefer not to have multiple unique webapps all pointing to the same virtual ip.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.