PDA

View Full Version : 2 Load balancer and 2 web servers



autofocus
24-Jun-2014, 03:39
Hi
I am trying to setup 4 machine cluster with SLES 11 SP3 and High Availability extension. This is first time I am attempting something like this.

Virtual IP is 192.168.1.1
and machine addresses are
192.168.1.2 - sles01
192.168.1.3 - sles02
192.168.1.4 - sles03
192.168.1.5 - sles04

I want to use sles01 and sles02 as load balancers and sles03, sles04 as web server running apache.
Now I have cluster running but at the moment all four machines are running apache.

http://i.imgur.com/U9bfKIW.png

I used IPLB- Virtual Service Configuration to setup 192.168.1.1:80 as virtual server and real servers as 192.168.1.4 and 192.168.1.5 with forward method as gate.

Now when I visit 192.168.1.1/index.php, I can see that the page is being served from 192.168.1.4/sles03 as index.php in that server contain a line which output its IP address. When I put sles03 to standby and visit the url i expect it to serve page from sles04 but cluster now looks for that page on sles01 where it doesn't exist, and when I put sles01 on standby virtual ip points to sles02. page from sles04 is only served when all other machines are on standby in Pacemaker GUI.

I have a feeling that I m doing something wrong here but can't figure out.

Do I need to create separate clusters for load balancers and web servers?


Thanks

jmozdzen
24-Jun-2014, 15:06
Hi autofocus,

Do I need to create separate clusters for load balancers and web servers?
since I cannot see the details from the screen shot added above (I prefer to look at & quote CIB XML elements ;) ), it might be that your grouping is set up unfavorable.

Have you tried creating two resource groups, one for the load balancer and one for the actual web server, and set location constraints?

BTW, it' might be a better design to allow for everything run on a single machine (if three servers fail) or on the "other" servers (if the wrong two machines fail)...

Regards,
Jens

David Gersic
25-Jun-2014, 19:30
On Tue, 24 Jun 2014 02:44:01 +0000, autofocus wrote:

> Hi
> I am trying to setup 4 machine cluster with SLES 11 SP3 and High
> Availability extension. This is first time I am attempting something
> like this.

It's possibly only a theoretical concern, but with clusters it's best to
have an odd number of nodes. You might want to add one more node to this.


> Virtual IP is 192.168.1.1
> and machine addresses are
> 192.168.1.2 - sles01
> 192.168.1.3 - sles02
> 192.168.1.4 - sles03
> 192.168.1.5 - sles04
>
> I want to use sles01 and sles02 as load balancers and sles03, sles04 as
> web server running apache.
> Now I have cluster running but at the moment all four machines are
> running apache.

Why are all four running Apache? Given what you're trying to do, you
should have two resource groups for the load balancers, with constraints
so that they run on sles01 or sles02, and two for the Apache web servers,
with constraints so that they run on sles03 or sles04.


> [image: http://i.imgur.com/U9bfKIW.png]
>
> I used IPLB- Virtual Service Configuration to setup 192.168.1.1:80 as
> virtual server and real servers as 192.168.1.4 and 192.168.1.5 with
> forward method as gate.

I'd work on getting the web server resource groups working first. Then
worry about getting the load balancer resource groups working.


> Now when I visit 192.168.1.1/index.php, I can see that the page is being
> served from 192.168.1.4/sles03 as index.php in that server contain a
> line which output its IP address. When I put sles03 to standby and visit
> the url i expect it to serve page from sles04 but cluster now looks for
> that page on sles01 where it doesn't exist, and when I put sles01 on
> standby virtual ip points to sles02. page from sles04 is only served
> when all other machines are on standby in Pacemaker GUI.

It sounds like your resource groups aren't constrained to the nodes you
want them to run on.


--
--------------------------------------------------------------------------
David Gersic dgersic_@_niu.edu
Knowledge Partner http://forums.netiq.com

Please post questions in the forums. No support provided via email.
If you find this post helpful, please click on the star below.

autofocus
04-Jul-2014, 06:20
Thanks for reply

I have just managed to successfully run cluster.
I am not yet sure it is the right way as I was following many tutorials simultaneously.
cluster resource.xml (https://gist.github.com/anonymous/e0ae8a0c55d7467606f4)

I am working on VMs and for testing the cluster, I wanted to have minimum number of machines required to run. I'll add another machine on production infrastructure as suggested.
Now I have to read more about conntrakd and other stuff related to cluster.
This was the biggest hurdle.




Thanks