简体   繁体   English

应用程序故障转移在配置了BIG IP(f5)负载平衡器的apache 2.2 Web服务器中不起作用

[英]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 . 我在集群配置中的JBOSS 5.2应用程序服务器之前使用Apache 2.2。 The two nodes of the cluster configuration resides on different host . 群集配置的两个节点位于不同的主机上。 This configuration is hosted on Linux servers . 此配置托管在Linux服务器上。

In this configuration I am using a BIG IP (F5) Load Balancer , which sits in between the Web server and Jboss application servers . 在此配置中,我使用的是BIG IP(F5)负载平衡器,它位于Web服务器和Jboss应用程序服务器之间。

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. 但是我的apache Web服务器无法将请求路由到群集的工作节点,并给出了所请求的应用程序服务器不可分发的错误。 However when I restart the apache server it seems to work fine and I am able to access the application . 但是,当我重新启动apache服务器时,它似乎可以正常工作,并且能够访问该应用程序。

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 . 出现故障转移后,当我尝试访问Web服务器URL时,似乎apache正在缓存应用程序服务器url,并且缓存没有刷新。

Below is the httpd.conf configuration that I am using : 以下是我正在使用的httpd.conf配置:

<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 . 问题似乎与DNS缓存有关。 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 . 我的apache服务器在发生故障转移的情况下无法解析DNS条目,并且它使用的是过时的DNS条目并指向失败的节点。 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 . 而且,当我重新启动apache服务器时,它能够解析正确的DNS条目,并且运行良好。为了避免在故障转移的情况下重新启动到apache服务器,我使用了一个参数“ disablereuse = On”以及ProxyPass参数,如下所示: ProxyPass / https:// myapp.abc.stg.asd:8443 / disablereuse = on现在, 在进行故障转移的情况下,apache可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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