0

I've got a windows service that is self-hosting the Asp.Net WebAPI. This works great and I can send GET requests successfully.

However I am also trying to host this service in a Windows 2012 Failover Cluster. I have set the service up as a 'Generic Serivce' role and can failover this from one machine to another. The problem comes in trying to hit the WebAPI on the cluster. When I try and call it using the Roles IP address I get a http 400 - Bad Request error. If I go via localhost then it works (well from the machine that is running the service).

Does anyone have any thoughts on how to access the WebAPI using the role IP address?

Imgur

Andy Davies
  • 101
  • 1
  • Have you set up an associated IP address as a cluster resource? By the way a failover cluster for a WebAPI app seems a little unusual. Why not load balance it? – Chris McKeown Aug 01 '14 at 12:50
  • I've added a picture to show my configuration. The server for my role has an ip address, is that what you meant? (sorry I've not really tried to do anything other than host a service that ran in isolation before). Good question re load balancing. Essentially its because the cost of making the service capable of running in a load balancer is too much at the moment, so putting it in a cluster at least gives us some redundancy. – Andy Davies Aug 01 '14 at 15:27
  • I agree with @ChrisMcKeown - it would be much more granular to host the WebApi inside IIS and load-balance it. – pauska Aug 01 '14 at 15:28
  • @AndyDavies use [NLB](http://technet.microsoft.com/en-gb/library/bb742455.aspx) - it's built into Windows Server. Failover clustering is overkill by the sounds of it. – Chris McKeown Aug 01 '14 at 21:35

1 Answers1

0

The HTTP 400 errors might be indicative of IIS rejecting the request due to no binding that matches the host header. This would happen if you've bound the app to an IP address which exists on one server but not the other. Your cluster resource group needs an IP address resource, which 'floats' between the nodes along with the app itself. This is in addition to the dedicated IP addresses of each cluster node.

If you're looking for redundancy, your problem will likely be better solved by using a load balancer. For a no-added-cost solution, look into using the Windows Network Load Balancing service.

Chris McKeown
  • 7,168
  • 1
  • 18
  • 26