Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of service fabric cluster node type app port range?

By default, when you create service fabric cluster manually using azure portal, you will have to pick a node type name which will be tied to VM size etc. However what is not shown on the GUI is the application port range that is associated with this node type. The default application port range appears to be from 20000 to 30000.

When you create a service fabric cluster application using visual studio, the default port numbers are always less than 20000. The default port number is more like 8868 or something like that.

When you deploy this service to the above cluster, everything works as expected. Lets ignore the LB port mapping for this discussion.

This begs following questions:

  1. Are we supposed to adjust the port number in our visual studio projects to something greater than 20000 (but less than 30000) so that the port numbers are in sync with node type construct's application port range?
  2. Obviously the service works without step (1). But are there any caveats to doing the default way (i.e. without any port number changes)?
  3. If service port numbers do not have to be in the range defined by node type construct, then what is the purpose of the application port range in the node type?
like image 845
Raghu Avatar asked Sep 12 '25 12:09

Raghu


1 Answers

The application port range is used when you let Service Fabric do Service discovery and resolution. If you don't specify end point ports, Service Fabric automatically assigns endpoints in this app port range that you provide while creating the cluster. Each service in Service Fabric cluster works based on an endpoint. Say if you have multiple microservices but you need only few services to be exposed with a http(s) endpoint, then you let Service Fabric decide the port for the services that you don't want to expose with http(s) endpoint. This port range also becomes handy when you want to configure port ranges in firewall or NSGs to open up traffic.

More details can be found here - https://azure.microsoft.com/en-gb/documentation/articles/service-fabric-connect-and-communicate-with-services/

Service Fabric provides a discovery and resolution service called the Naming Service. The Naming Service maintains a table that maps named service instances to the endpoint addresses they listen on. Service Fabric has a registrar that maps service names to their endpoint address.

like image 83
Hariprabu Jagadeesan Avatar answered Sep 15 '25 04:09

Hariprabu Jagadeesan