1
votes

Hi there I am trying to implement a simple load balancing experiment: Changing between the 3 load balancer scheduler algorithms available for use: Request Counting, Weighted Traffic Counting and Pending Request Counting.

Reference: http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html I configured my conf file in apache server as such:

code:

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
 LoadModule proxy_module modules/mod_proxy.so
  LoadModule proxy_http_module modules/mod_proxy_http.so

  LoadModule    jk_module  modules/mod_jk.so
 JkWorkersFile conf/workers.properties
   JkShmFile     logs/mod_jk.shm
  JkLogFile     logs/mod_jk.log
 JkLogLevel    info
   JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
  #JkMount  /examples/jsp/dates* balancer
 JkMount /Prototype* balancer

# This proxy tag is for Pending Request Counting Algorithm BalancerMember ip1 loadfactor=1 BalancerMember ip2 loadfactor=1

 ProxySet lbmethod=byrequests#Request Counting Algorithm
 BalancerMember http://192.168.0.2/ # Balancer member 1
 BalancerMember http://192.168.0.10/ # Balancer member 2
  ProxySet lbmethod=bybusyness
  </Proxy>

However, I keep getting the error:BalancerMember can not have a balancer name when defined in a location

from this line: BalancerMember "//192.168.0.2/" # Balancer member 1

Please help

1

1 Answers

5
votes

Somehow apache doesn't like the comments at the end of your BalancerMember entries.

If you move the comments on a new line I should work

code:

# Balancer member 1
BalancerMember http://192.168.0.2/
# Balancer member 2
BalancerMember http://192.168.0.10/