表现在应用上是这样的:当我执行一个查询生成一个临时文件,然后我再去下载这个临时文件时,会话转向另外一个server去查找文件,由于静态的文件不能被failover,所以会发生找不到文件的情况。
java.io.FileNotFoundException: /data/cncbss/cncBssCluster/mserver2/applications/DefaultWebApp/DefaultWebApp/account/temp/yMcgF0NBy1zh8hbqCTw41GGWZGYnVYjhJjd2bWvzc2b3stZK3n0j!-90604744!1696053682!1169460641300.dat (No such file or directory)
The Dynamic Server List
When you use the WebLogicCluster
parameter in your httpd.conf
orweblogic.conf
file to specify a list of WebLogic Servers, the plug-in uses that list as a starting point for load balancing among the members of the cluster. After the first request is routed to one of these servers, a dynamic server list is returned containing an updated list of servers in the cluster. The updated list adds any new servers in the cluster and deletes any that are no longer part of the cluster or that have failed to respond to requests. This list is updated automatically with the HTTP response when a change in the cluster occurs.
试着关闭了DynamicServerList,重启apache,系统页面响应飞快。
我是这样认为的,WebLogic使用了round-robin affinity算法,同时关闭了DynamicServerList就意味着apache不再将请求路由到别的server上。
虚拟主机的配置如下:
<VirtualHost 192.168.0.8:9999>
ServerName 192.168.0.8:9999
DocumentRoot /CNC/
CustomLog "|/usr/local/sbin/cronolog /CNC/ApacheLog/bssCluster/%w/access_9999_log" combined
<IfModule mod_weblogic.c>
WebLogicCluster 192.168.0.17:8002,192.168.0.18:8004
MatchExpression *.jsp
MatchExpression *.htm
MatchExpression *.html
Idempotent ON
KeepAliveEnabled ON
DynamicServerList OFF
</IfModule>
</VirtualHost>