1

I would like to learn about load balancing with servers.

Is there a way that I could simulate many servers in my machine and configure Apache for the load balancing? This is: see how it works live.

I just have one machine and no possibility to go to a lab :/

  • You'd either need enough hardware to simulate identical VMs and tinker around with it (doesn't sound like you have this), or you'll have to do rough paper calculations based on the information you have available. Even in case 1, a lab environment isn't the same as a production environment, and may not give accurate results. – Bigbio2002 Jun 14 '12 at 19:32
  • I would like to test small things, just to see how it works. Is there a way that I could do that –  Jun 14 '12 at 19:36
  • What is the base for the load-balancer? IPs? Sessions? MACs? – Nils Jun 14 '12 at 21:14
  • I believe that IPs in terms that you redirect the load to a server -could be the same IP with different port-. AJP manage sessions, and you could force that the server resolve the request of a session -with sticky session- (http://wiki.magnolia-cms.com/display/WIKI/Guide+-+How+to+configure+an+apache+load+balancer). Please, if I'm wrong correct me! I want to test in the wire, and don't know how to start :/ –  Jun 14 '12 at 21:18

3 Answers3

2

Kani, I am doing exactly the same as you at the moment.

I installed VirtualBox on my PC, then I created a new Virtual Machine and installed CentOS on it. I configured the networking to be bridged so it has a visible network address to other devices on the network. I installed the applications I needed specifically Apache HTTP.

Afterwards, I shutdown the virtual machine then fully cloned it with a new MAC address 2 times to create 2 more machines exactly the same. As they have different MAC addresses they all pick up different network addresses from the DHCP server. Our DHCP server gives the same address out to the same machines so as long as you use the virtual machines regularly then they'll keep there addresses so you won't have to organise static addresses from your network administrator.

It was quite easy and only took a few hours to set up.

David Newcomb
  • 275
  • 1
  • 5
  • 14
1

just make apache listen on different ports with different vhosts listening on each.

if you want to test failover use iptables to block access to some of them. if you want to check for session stickiness check logs for each of vhosts.

but... in fact you might be better off creating few virtual machines and having 'closer to real' setup.

pQd
  • 29,981
  • 6
  • 66
  • 109
0

If you want to do some testing, install some virtualization software, create some VMs with the software/OSes you want to use, and play around with them. Note that you'll need plenty of RAM for this.

Bigbio2002
  • 2,823
  • 12
  • 35
  • 54