问题
I have a system that uses stateless services hosted in Service Fabric
This is running in a local dev cluster with 5 nodes
Some of my services have InstanceCount set to -1
I was expecting to see multiple instances of the host executables to show in task manager but I only see 1
This is making me think there is only 1 instance
Am I doing something wrong?
Paul
回答1:
There is not enough information to determine what the actual problem here is, but based on your description I might suspect of two possible reasons:
There is an error activating your services: If SF shows in the explorer that your service has any error or warnings, the problem might be because it couldn't start more than one instance of that service on the same node, this is common to happen if you have for example two apis\sites listining on the same port, this is very common to happen on local dev clusters where all the nodes are setup on same machine, but for SF they seems like a different node.
Your services are sharing the same process: On SF, when you run multiple replicas(stateless instances) of same package on same node they will usually share the same process by default, it could be the case of your service being sharing the same process, but is hard to say, as you didn't provide much information on how your services are defined.
As stated at the beginning, it is just a guess, because you didn't provide much information about your service structure we can't tell exactly what is going on behind the scenes and these are the most probable reasons.
来源:https://stackoverflow.com/questions/49694700/service-fabric-stateless-cluster-has-5-nodes-but-app-only-has-1-instance