简体   繁体   中英

'TargetInvocationException' when multiple instances on Service Fabric cluster

TargetInvocationException getting thrown at the owincommunicationlistener class when multiple instances are created on the service fabric cluster, if i set the instance count to 1 , everything is fine. but when i increase it, the Exception gets thrown at the point where the web server starts.

Inner exception shows "Failed to listen on prefix 'htto://+:8961' because it conflicts with an existing registration on the machine"

On Windows, Service Fabric leverage http.sys capabilities for HTTP listeners, make sure you follow the rules of http.sys. When running multiple instances (from different nodes) on the same machine, you need to have unique HTTP URL to prevent conflicts. As a guideline, the following link explains how http.sys works: https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/a2a45c42-38bc-464c-a097-d7a202092a54.mspx?mfr=true

Same mechanism is used by IIS, but you don't need IIS to leverage Http.sys.

Consider working in single node mode locally to work around the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM