Create and run another web service on Server 2 (in this case it on 10.0.1.86)
1. Repeat the same steps similar to the ones done on Server 1
2. Finally the exposed web service should have a URI, http://10.0.1.86:8091/hello?wsdl
2. Finally the exposed web service should have a URI, http://10.0.1.86:8091/hello?wsdl
Now that we have 2 services running on 2 different servers, configuration of LB for these servers can be done.
Install and configure HTTPD Server as LB instance
1. Download and install apache httpd server. (If already exists, then skip to next step). This can be downloaded fromhttp://httpd.apache.org/download.cgi
2. Configure httpd-proxy-balance.conf
a. Required to keep this file under ‘conf/extra/’ folder
b. httpd-proxy-balance.conf should look like
2. Configure httpd-proxy-balance.conf
a. Required to keep this file under ‘conf/extra/’ folder
b. httpd-proxy-balance.conf should look like
<IfModule mod_proxy_balancer.c> ServerName www.mycompany.com ProxyRequests off <Location /balancer-manager> Set Handler balancer-manager Order deny,allow Allow from all </Location> ProxyPass /balancer-manager ! ProxyPass / balancer://mycluster/ stickysession=SESSION_ID <Proxy balancer://mycluster > BalancerMember http://10.0.1.86:8091 loadfactor=4 route=node1 BalancerMember http://10.0.1.43:8091 loadfactor=6 route=node2 # Load Balancer Settings # We will be configuring a simple Round # Robin style load balancer. This means # that all webheads take an equal share of # of the load. ProxySet lbmethod=byrequest </Proxy> </IfModule>
3. Configure httpd.conf
a. Make sure they are uncommented following modules
a. Make sure they are uncommented following modules
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule proxy_module modules/mod_proxy.so
b. Add this line
Include conf/extra/httpd-proxy-balancer.conf
c. Save and restart, httpd
ASSERT LB ACTIVITY
1. Point at the browser, and access http://<>:8090/ In this case it is http://10.0.1.86:8090/hello?wsdl
2. This will take us to the exposed web service on a round robin basis and shares equal load between 10.0.1.43 and 10.0.1.86
2. This will take us to the exposed web service on a round robin basis and shares equal load between 10.0.1.43 and 10.0.1.86
Hi,
ResponderEliminarIn case of multiple http endpoints say 8092,8093,etc., how the configuration will look like in apache httpd server?
Thanks...
very useful information, the post shared was very nice.
ResponderEliminarMulesoft Online Training