Alva A
Alva A

Reputation: 35

Service Fabric: Addressing Service on Stand-Alone Cluster

I have set up a three node standalone cluster. I have placed an application on the cluster that contains three services, the application is configured such that an instance of each service will reside on each node. Of the three services, one of them is a front-end service that receives requests from external clients and then communicates with the other two services (which are not addressible from outside of the cluster) to get the information needed for the response. An external client program has been written to communicate with the front-end service via http requests. Currently, this external client must send its request to a particular service instance using the node ip address and port. The problem I am having with this approach is that if the node that is being addressed by the external client goes down, the client is no longer able to address the service although the front end service is still running on two other nodes.

Here is my question: Is there a way for the external client to call the front-end service through Service Fabric without specifying a specific node to communicate with? My hope is that such a communication method would allow requests to be routed to an alternate node if the original node receiving the request were to go down.

Upvotes: 0

Views: 347

Answers (1)

Vaclav Turecek
Vaclav Turecek

Reputation: 9050

You should be using a load balancer in front of your cluster to distribute traffic to your front-end service instances. The load balancer should be configured to take nodes out of the load balancer's rotation if they are not responding to user requests. This helps protect your services and your users from outages.

If your users are within a trusted boundary (e.g., Intranet users), then the alternative to a load balancer would require the client application to first do a service address look-up with Service Fabric's naming service, which will give you a list of endpoints of each stateless service instance that is available. Again, you don't really want to expose this to untrusted users because they can easily abuse it or overload it. If you do this you're relying on your client application to provide load balancing by picking a random instance to connect to. But really what you should do is get a load balancer.

Upvotes: 1

Related Questions