4

Does there exist a simple Load Balancer app for development on Windows? I am running a pair of JBoss 5.x instances in a cluster on a single machine. Normally , this configuration is load balanced by a nice hardware load balancer but I am wondering if there is a simple piece of software to enable load balancing in my Eclipse dev environment.

Basically, for example, I want a load balancer running on port 11111 that round-robins between the 2 clustered JBoss instances on ssl ports 8443 and 8543 . (or http port if thats not possible)

I know that Glassfish has a built-in load balancer but I can't use Glassfish.

One idea I have is to try to setup a separate instance of Tomcat with the "balancer" web app. Im trying that now... not sure if it will work... and its a complicated setup and I wish there was something really easy.

djangofan
  • 2,851
  • 9
  • 34
  • 35

3 Answers3

7

You can use use Nginx

Install nginx and add config file:

http {
  upstream myproject {
    server 127.0.0.1:8000;
    server 127.0.0.1:8001;
  }

  server {
    listen 80;
    server_name localhost;
    location / {
      proxy_pass http://myproject;
    }
  }
}
Onbayev Kanat
  • 81
  • 1
  • 2
  • 2
    Thanks - had it up and running in 5 min. As opposed to banging my head on the wall for 2.5 hours trying to get IIS ARR runnning! I had to also add an empty events section: "events" {} at the top – avvi Jul 30 '20 at 13:07
2

You could use Apache HTTP Server with the mod_proxy_balancer module.

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
Snark
  • 32,299
  • 7
  • 87
  • 97
0

Instead of load balancing between ports, why not bind each instance to a specific loopback IP address. The whole 127.0.0.0/8 network is loopback (not just 127.0.0.1). If you configure your processes to bind to 127.0.0.2 and 127.0.0.3 (or whatever you want) then you can do IP round robin. This can be done with DNS if you wish.

You could also write a wrapper that binds to an IP/port and will randomly forward the connection to one of the servers, and just pass the data through.

Tyler Szabo
  • 571
  • 1
  • 3
  • 14