Azure Service Fabric本地集群安装连接失败求助
Hey there, sorry to hear you're stuck with this local Service Fabric cluster issue—let's work through it step by step. First, let's recap the error you're hitting to make sure we're aligned:
Connect-ServiceFabricCluster : No cluster endpoint is reachable, please check if there is connectivity/firewall/DNS issue.
At C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Scripts\ClusterSetupUtilities.psm1:620 char:12
- [void](Connect-ServiceFabricCluster @connParams)
- CategoryInfo : InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricException
- FullyQualifiedErrorId : TestClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster
Since you've already tried common fixes from Stack Overflow and MSDN, let's dive into some targeted troubleshooting steps:
Verify critical port availability
Service Fabric local cluster relies on ports like19000(client connection),19080(HTTP management), and19001(cluster communication). Run this command in an elevated PowerShell to check if these ports are in use:netstat -ano | findstr ":19000 :19080 :19001"If you see a PID listed, find the corresponding process in Task Manager and terminate it—then restart the Service Fabric cluster.
Reset your local cluster
Corrupted cluster state is a common culprit. Open the Service Fabric Local Cluster Manager from your system tray, select Reset Cluster, and confirm. This will wipe existing cluster data and rebuild it from scratch (back up any important test data first if needed).Check the Service FabricHostSvc service
Ensure the core service is running correctly:- Press
Win + R, typeservices.msc, and hit Enter. - Locate Service Fabric Host Service (ServiceFabricHostSvc).
- If it's stopped, start it; if running, right-click and select Restart.
- Set its startup type to Automatic to avoid issues on reboot.
- Press
Test manual cluster connection
Run this elevated PowerShell command to connect directly and get more detailed error context:Connect-ServiceFabricCluster -ConnectionEndpoint localhost:19000 -KeepAliveIntervalInSec 10If this fails, note any additional error messages—they might point to specific issues like certificate problems or DNS resolution failures.
Validate localhost DNS resolution
Make surelocalhostresolves correctly to127.0.0.1:- Open Command Prompt and run
ping localhost. - Check your
hostsfile (located atC:\Windows\System32\drivers\etc\hosts) to ensure there are no rogue entries overriding localhost's resolution.
- Open Command Prompt and run
Inspect cluster configuration files
Navigate toC:\SfDevCluster\Dataand look for theClusterManifest.xmlfile. Verify that the node endpoints are configured to uselocalhostor127.0.0.1(not a specific external IP address that might not be available on your dev machine).Reinstall the Service Fabric runtime (with compatibility in mind)
Since you're using VS 2017, make sure you install a runtime version that's compatible with it (newer versions may drop support for older VS editions). Uninstall the current runtime via Programs and Features, download a compatible version, and run the installer as Administrator.
Let me know if any of these steps resolve your issue, or if you get more specific error messages we can dig into further!
内容的提问来源于stack exchange,提问作者gtestasker

