简体   繁体   中英

Application Fail over not working in apache 2.2 web server configured with BIG IP (f5) load balancer

I am using Apache 2.2 in front of my JBOSS 5.2 application server in a cluster configuration . The two nodes of the cluster configuration resides on different host . This configuration is hosted on Linux servers .

In this configuration I am using a BIG IP (F5) Load Balancer , which sits in between the Web server and Jboss application servers .

In case of failover of one of the application server , the load balance is working fine and is routing the request from one node of cluster to the other node . But my apache web server is not able to route the request to working node of cluster and gives the error that the application server being requested is not rachable. However when I restart the apache server it seems to work fine and I am able to access the application .

It seems that apache is caching the the application server url and cache is not getting refreshed when I try to access the web server URL after the failover occurs .

Below is the httpd.conf configuration that I am using :

<VirtualHost 10.38.205.100:443>
DocumentRoot /var/www
ErrorLog /etc/httpd/logs/error.log
TransferLog /etc/httpd/logs/access_log
CustomLog /etc/httpd/logs/ssl_access.log combined
# Enable Server on this Virtual host
SSLEngine on
# Disable SSLV2 in  favour of more robust SSLV3
SSLProtocol all -SSLv2
# List of supported cryptografic server cipher suites
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
#Apache Server certificate
SSLCertificateFile /home/users/domain.com.ssl/MyWebServer.crt
#Apache server private key
SSLCertificateKeyFile /home/users/domain.com.ssl/MyWebServer.key
#Chain Certificate
SSLCertificateChainFile /home/users/domain.com.ssl/cat.txt
# It's mandatory for apache to authenticate the client's certificates
SSLVerifyClient none
SSLVerifyDepth 10

ProxyRequests Off
ProxyPreserveHost On

<Proxy *>
Order deny,allow
Allow from all
</Proxy>
## Load Balancer url : https://myapp.abc.stg.asd:8443/
SSLProxyEngine on
ProxyPass / https://myapp.abc.stg.asd:8443/
ProxyPassReverse / https://myapp.abc.stg.asd:8443/

<Location />
Order allow,deny
Allow from all
</Location>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 120 minutes"
ExpiresByType image/jpeg "access plus 120 minutes"
ExpiresByType image/png "access plus 120 minutes"
ExpiresByType text/css "access plus 60 minutes"
ExpiresByType text/javascript "access plus 60 minutes"
ExpiresByType application/x-javascript "access plus 60 minutes"
ExpiresByType text/xml "access plus 60 minutes"
</IfModule>
</VirtualHost>

Please correct me If I am wrong somewhere . Any help would be appreciated . Thanks ..!!

After a lot of study on the Internet , I was able to resolve the issue yesterday . The issue seems to be with DNS caching . My apache server was not able to resolve the DNS entry in case of failover and it was using the stale DNS entry and pointing to the node wich has failed . And when I restart the apache server it was able to resolve correct DNS entry and works perfectly fine.To get rid of restarting to apache server in case of failover I have used one parameter "disablereuse=On" Along with ProxyPass parameter as below : ProxyPass / https:// myapp.abc.stg.asd:8443/ disablereuse=on Now apache is working fine in case of failover .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM