我使用 apache httpd 作为负载均衡器,所有的肥皂请求都正常工作,并且正在通过负载均衡器导航。但问题是我对负载均衡器的所有 restfull 请求都返回 404。
我在此处附加了负载均衡器配置和 java webservice 代码:
Listen 7060
<VirtualHost *:7060>
ServerName domain.com
ProxyRequests off
<Proxy balancer://mycluster>
# StartBalancerMember
BalancerMember http://127.0.0.1:7071/
BalancerMember http://127.0.0.1:7072/
BalancerMember http://127.0.0.1:7073/
BalancerMember http://127.0.0.1:7074/
BalancerMember http://127.0.0.1:7075/
BalancerMember http://127.0.0.1:7076/
BalancerMember http://127.0.0.1:7077/
BalancerMember http://127.0.0.1:7078/
BalancerMember http://127.0.0.1:7079/
# EndBalancerMember
# Security "technically we aren't blocking anyone but this the place to make those chages
Order Deny,Allow
Deny from none
Allow from all
# 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=byrequests
</Proxy>
# balancer-manager This tool is built into the mod_proxy_balancer module and will allow you to do some simple modifications to the balanced group via a gui web interface.
<Location /balancer-manager>
SetHandler balancer-manager
# I recommend locking this one down to your your office
Order deny,allow
Allow from all
</Location>
# Point of Balance This setting will allow to explicitly name the the location in the site that we want to be balanced, in this example we will balance "/" or everything in the site.
ProxyPass /balancer-manager !
ProxyPass / balancer://mycluster/
</VirtualHost>
@Service
@Produces("application/json")
@Consumes("application/json")
@Path("/executionRest")
public class RestWebService {
@Resource
private ExecutionManager executionManager;
@GET
@Path("/restTest")
public String testInvocation() {
return "Rest test";
}
}
如果我直接在浏览器中输入第一个成员 uri:
http://localhost:7071/bdes/ws/rs/executionRest/restTest
我得到“休息测试”作为回应
但如果我在浏览器中输入:
http://localhost:7060/bdes/ws/rs/executionRest/restTest
我得到404!
我是否错过了负载均衡器中的某些内容或配置问题?
提前致谢