server failover test issue from apache web server to jboss application - apache

I have used the proxypass and reverse proxypass inside the httpd.conf in apache server to repoints requests to particular JVM in JBoss server.
I have 2 JBoss servers...during a failover test..one JBoss server is stopped abruptly...the apache cant identifies that the one JBoss server is stopped and hence cant redirect request to the other server.
Any help on this?

try
<Proxy balancer://BALANCER_NAME>
BalancerMember https://foo1.bar:443 ping=1 loadfactor=1
BalancerMember https://foo2.bar:443 status=+H ping=1
</Proxy>
ProxyPass / balancer://BALANCER_NAME/
ProxyPassReverse / balancer://BALANCER_NAME/
In this configuration all is sent to foo1 and foo2 is in hot standby (status=+H)

Related

apache2 proxy balancer - passing server name

I'm using apache2 as a local proxy balancer between the web and a jboss machine.
i've used the following configuration:
<Proxy balancer://mycluster>
BalancerMember http://localhost:8080
</Proxy>
ProxyPass /test balancer://mycluster
if i call my machine with www.mymachine.com/test then the call is passed to JBoss, but in the request it seems that it was called with 'localhost'.
how can I make sure the correct server name is passed as well?
Aviad
all i needed to do is to add:
ProxyPreserveHost On

tomcat7 hot-standby Node with mod-cluster and Apache HTTPD2.2

I'm using tomcat7.0.63 with mod-cluster1.2.9 and Apache HTTPD2.2 on RHEL6.7
Multiple Tomcat-instances with dedicated balancer configurations are sharing the Apache HTTPD using dedicated Virtualhost:6666.
Only one Tomcat instance should have a Master-Node and a Hot-Standby Node.
I tried with mod-proxy-balancer, BalancerMember, with and without ModClusterListener in server.xml. But it seens the coexistence with mod-cluster on a shared Apache HTTPD is not working...or I make a mistake.
ProxyPass / balancer://mycl/
ProxyPassReverse / balancer://mycl/
<Proxy balancer://mycl>
BalancerMember ajp://1.2.3.9:8009 route=master retry=30
# The server below is on hot standby
BalancerMember ajp://1.2.3.4:8009 route=standby status=+H
</Proxy>
For JBoss EAP and Wildfly there is the lbfactor/loadfactor:
<simple-load-provider factor="0"/>
which makes one node to a hot-standby node.
Is there a way to do so with tomcat7, e.g. a mod-cluster Tomcat system-property which sends a load = 0 (standby) to Virtualhost:6666 ?
kind regards, hplar

Endeca cluster load balancing

I have an Endeca cluster setup with 3 dgraph(1 EAC Central Server and 2 EAC agent only instances). I am trying to put an Apache mod_proxy load balancer for testing purpose before the MDEX engines(I am using presentation API to hit the MDEX engine(we are working on assembler API also)). We shall be having an F5(or Nginx, which one shall be better?) hardware load balancer when we'll shall do the actual deployment. My apache server is listening at port 5555, All my Dgraphs are running at port 15000 on three different host. I'm directing the all my queries to apache load balancer.
MDEX_HOST = localhost
MDEX_PORT = 5555
private static ENEConnection createConnection() {...}
And here is my Apache Load balancer configuration. Load balancer modules included in httpd.conf file mod_proxy, mod_proxy_balancer, mod_proxy_connect, mod_proxy_http, mod_negotiation. I have put the load balancer configuration in httpd-vhosts.conf file.
NameVirtualHost *:5555
<VirtualHost *:5555>
Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/"
env=BALANCER_ROUTE_CHANGED
ServerName localhost
ProxyPass / balancer://cluster/
<Proxy balancer://cluster>
BalancerMember http://172.16.26.129:15000 loadfactor=1 retry=0 route=1
BalancerMember http://172.16.26.210:15000 loadfactor=1 retry=0 route=2
BalancerMember http://172.16.27.87:15000 loadfactor=1 retry=0 route=3
Order Deny,Allow
Deny from none
Allow from all
ProxySet lbmethod=byrequests
ProxySet stickysession=ROUTEID
</Proxy>
</VirtualHost>
<Location /balancer-manager>
SetHandler balancer
</Location>
When I do a query(Type ahead service) I'm getting the following error..
** Error Fri Apr 10 20:05:53 IST 2015 1428676553858 /atg/rest/processor/RestActorManager Caused by (#6):com.endeca.navigation.ENEException: HTTP Error 404 - Navigation Engine not able to process request 'http://localhost:5555/search?terms=je&rank=0&offset=0&irversion=640'.
Can anyone please see my load balancer configuration what I'm doing wrong? Thanks

Connections from Apache to Tomcat using proxypass are not closed after each request

I currently have apache2 configured so that requests on specific urls such as /myapp are directed to my internal tomcat server at tomcathost:8080/myapp.
All the requests to myapp to apache2 work as expected.
The problem that I'm facing is that whenever a request is sent to myapp trough apache2 it seems that apache2 is keeping the connection open to tomcat and after a while all the threads in tomcat are taken by apache and apparently not released.
Could somebody point me in the right direction to solve this issue ?
ProxyPass /myapp balancer://apps/myapp
ProxyPassReverse /myapp balancer://apps/myapp
<Proxy balancer://apps>
BalancerMember http://appserver01:8080 route=Node01 loadfactor=1
BalancerMember http://appserver02:8080 route=Node02 loadfactor=1
ProxySet lbmethod=byrequests
ProxySet stickysession=JSESSIONID|jsessionid
ProxySet nofailover=On
</Proxy>
You can set connectiontime out in server.xml so incase if any thread is open it get timedout.
connectionTimeout="120000"
Also you might use JConsole which is part of JDK installation to monitor threads via JMX for your tomcat to see if there is any loop of threads which causes increase in threads.

mod_ajp_proxy configurations and session stickiness

All,
I have a jboss and apache setup hosting my .war file. I have enabled session stickiness to forward requests from apache to jboss . Assume i have 2 apache and 2 jboss instances.
Is the below setting correct ? Currently session stickyness is not working and each time request is appended with a new JSESSSION ID.
<Proxy balancer://cluster>
Order deny,allow
Allow from all
BalancerMember ajp://1.1.1.1:8010/testing keepalive=On loadfactor=1 ping=10 ttl=600
BalancerMember ajp://2.2.2.2:8010/testing keepalive=On loadfactor=1 ping=10 ttl=600
</Proxy>
ProxyPass /testing balancer://cluster timeout=60 stickysession=JSESSIONID nofailover=On
Do i need to add route variable to the balancer member configuration ??? and do i need to enable useJK flag in jboss.
YES, you need to add route to each balancer member.
route=member1
route=member2
That is how Apache knows which way to direct later requests. Look at your cookies in your browser.