当前位置: 动力学知识库 > 问答 > 编程问答 >

java - apache(httpd) load balancer and restfull requests

问题描述:

I use apache httpd as a load balancer and all the soap requests are working properly and are being navigating through the load balancer. but the problem is that all my restfull request to the load balancer returns 404.

I attached the load balancer configuration, and the java webservice code here:

 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";

}

}

If i enter directly to the first member uri in browser:

http://localhost:7071/bdes/ws/rs/executionRest/restTest

i get "Rest test" as response

but if i enter in browser:

http://localhost:7060/bdes/ws/rs/executionRest/restTest

i get 404!

Do i miss something or it's configuration problem in my load balancer?

Thanks in advance

分享给朋友:
您可能感兴趣的文章:
随机阅读: