Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure service fabric Instance count

I am working on a POC with azure service fabric. Deployed my service in a local cluster and it's working fine with default settings in Local.xml.

The moment I change the instance count it's throwing following exception. Where is the option to change the instance count? Basically i am trying to run my service on two nodes now. It's working fine when it is the default value that is 1.

InnerException: HResult=-2146233088 Message=Error -4091 EADDRINUSE address already in use Source=Microsoft.AspNetCore.Server.Kestrel StatusCode=-4091

My local.xml is copied here

  <Parameters>
    <Parameter Name="Product_InstanceCount" Value="2" />
  </Parameters>

Any help really appreciated.

Thanks

like image 585
Jojo Peter Avatar asked Dec 19 '22 15:12

Jojo Peter


2 Answers

According to the official Microsoft documentation , you need to ensure that only one instance of the service is running when you deploy to a local cluster.Otherwise you will run into conflicts with multiple processes listening to same port .You can set multiple instances when you deploy to Azure.

Refer the documentation :- https://azure.microsoft.com/en-us/documentation/articles/service-fabric-add-a-web-frontend/

like image 121
Krishnanunni Jeevan Avatar answered Dec 24 '22 01:12

Krishnanunni Jeevan


When you are using local sf cluster and if you have fixed the service endpoint port, use only one instance. For example:

Service.Endpoint uses port 8090. This is defined in ServiceManifest.xml. In a local cluster actually everything just runs on one node i.e. your development machine. If you try to create 2 instances of same service with hard defined port, then you will get Port already in use error.

Try changing to one instance or move it to actual Azure cluster or remove hard coded port numbers.

like image 22
Gaurav Sharma Avatar answered Dec 24 '22 01:12

Gaurav Sharma