Azure Service Fabric:无法运行本地Service Fabric Cluster

时间:2016-05-30 16:55:56

标签: azure azure-service-fabric

我遇到Azure Service Fabric的问题。

我在https://azure.microsoft.com/en-gb/documentation/articles/service-fabric-get-started/中已经安装了它(在Windows 7上)。

然后我尝试从Visual Studio 2015运行Service Fabric应用程序。我收到错误“ Connect-ServiceFabricCluster:没有集群端点可以访问,请检查是否存在连接/防火墙/ DNS问题

以下是该次运行的填充日志:

1>------ Build started: Project: Application2, Configuration: Debug x64 ------
2>------ Deploy started: Project: Application2, Configuration: Debug x64 ------
-------- Package started: Project: Application2, Configuration: Debug x64 ------
  Application2 -> c:\temp\Application2\Application2\pkg\Debug
-------- Package: Project: Application2 succeeded, Time elapsed: 00:00:01.7361084 --------
2>Started executing script 'Set-LocalClusterReady'.
2>Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Scripts\DefaultLocalClusterSetup.psm1'; Set-LocalClusterReady
2>--------------------------------------------
2>Local Service Fabric Cluster is not setup...
2>Please wait while we setup the Local Service Fabric Cluster. This may take few minutes...
2>
2>Using Cluster Data Root: C:\SfDevCluster\Data
2>Using Cluster Log Root: C:\SfDevCluster\Log
2>
2>Create node configuration succeeded
2>Starting service FabricHostSvc. This may take a few minutes...
2>
2>Waiting for Service Fabric Cluster to be ready. This may take a few minutes...
2>Local Cluster ready status: 4% completed.
2>Local Cluster ready status: 8% completed.
2>Local Cluster ready status: 12% completed.
2>Local Cluster ready status: 17% completed.
2>Local Cluster ready status: 21% completed.
2>Local Cluster ready status: 25% completed.
2>Local Cluster ready status: 29% completed.
2>Local Cluster ready status: 33% completed.
2>Local Cluster ready status: 38% completed.
2>Local Cluster ready status: 42% completed.
2>Local Cluster ready status: 46% completed.
2>Local Cluster ready status: 50% completed.
2>Local Cluster ready status: 54% completed.
2>Local Cluster ready status: 58% completed.
2>Local Cluster ready status: 62% completed.
2>Local Cluster ready status: 67% completed.
2>Local Cluster ready status: 71% completed.
2>Local Cluster ready status: 75% completed.
2>Local Cluster ready status: 79% completed.
2>Local Cluster ready status: 83% completed.
2>Local Cluster ready status: 88% completed.
2>Local Cluster ready status: 92% completed.
2>Local Cluster ready status: 96% completed.
2>Local Cluster ready status: 100% completed.
2>WARNING: Service Fabric Cluster is taking longer than expected to connect.
2>
2>Waiting for Naming Service to be ready. This may take a few minutes...
2>Connect-ServiceFabricCluster : **No cluster endpoint is reachable, please check 
2>if there is connectivity/firewall/DNS issue.**
2>At C:\Program Files\Microsoft SDKs\Service 
2>Fabric\Tools\Scripts\ClusterSetupUtilities.psm1:521 char:12
2>+     [void](Connect-ServiceFabricCluster @connParams)
2>+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2>    + CategoryInfo          : InvalidOperation: (:) [Connect-ServiceFabricClus 
2>   ter], FabricException
2>    + FullyQualifiedErrorId : TestClusterConnectionErrorId,Microsoft.ServiceFa 
2>   bric.Powershell.ConnectCluster
2> 
2>Naming Service ready status: 8% completed.
2>Naming Service ready status: 17% completed.
2>Naming Service ready status: 25% completed.
2>Naming Service ready status: 33% completed.
2>Naming Service ready status: 42% completed.
2>Naming Service ready status: 50% completed.
2>Naming Service ready status: 58% completed.
2>Naming Service ready status: 67% completed.
2>Naming Service ready status: 75% completed.
2>Naming Service ready status: 83% completed.
2>Naming Service ready status: 92% completed.
2>Naming Service ready status: 100% completed.
2>WARNING: Naming Service is taking longer than expected to be ready...
2>Local Service Fabric Cluster created successfully.
2>--------------------------------------------------
2>Launching Service Fabric Local Cluster Manager...
2>You can use Service Fabric Local Cluster Manager (system tray application) to manage your local dev cluster.
2>Finished executing script 'Set-LocalClusterReady'.
2>Time elapsed: 00:07:01.8147993
2>The PowerShell script failed to execute.
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

6 个答案:

答案 0 :(得分:7)

这对我有用,我偶然发现了MSDN论坛上的solution

很可能您的C ++运行时已损坏且需要重新安装。 您必须手动执行可在

找到的vcredist_x64.exe
C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\vcredist_x64.exe

完成后,您可以选择是否重新启动计算机,我选择重新启动计算机,然后运行以下命令

 C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\CleanCluster.ps1
C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\DevClusterSetup.ps1

我希望这有帮助!

答案 1 :(得分:1)

我不得不断开VPN与办公室的连接,以及Varun上面显示的方向。

感谢@Varun分享这个!!

连接VPN后,我再也无法运行系统了。

希望这有助于某人。

答案 2 :(得分:1)

尝试了很多解决方案之后,我发现这个GitHub Issue有助于在设置配置中添加一个条目,然后我不得不重新创建集群。

配置文件

C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure\OneNode\ClusterManifestTemplate.json:

添加

的条目
{
  "name": "FabricContainerAppsEnabled",
  "value": "false"
}

答案 3 :(得分:0)

如果C ++运行时无法解决您的问题,您可以将解决方案缩小到仅防火墙问题。网络不允许用户运行 FabricHostSvc 服务,您可以在services.msc中检查该服务,这是由于安全问题。如果您能够无限制地禁用防火墙/更改网络,则问题应该自行解决。

如果您能够启动FabricHostSvc,您的问题将得到解决。

希望这会有所帮助.....

答案 4 :(得分:0)

默认情况下,Service Fabric开发实例正在运行以仅侦听环回地址(只需在CMD中运行netstat -an命令以查看哪些端口已打开):

enter image description here

正如您在上面的屏幕上看到的,我的SF实例正在端口19000上侦听所有地址(可用的外部连接)

默认情况下,端口19000仅侦听环回地址(127.0.0.1)

[::1]:19000

您只需将IPAddressOrFQDN从localhost更改为IPv4外部地址即可。 hange应该在清单文件中可见:

enter image description here

Windows 7中的所有SF群集配置文件都位于C:\SfDevCluster\Data中。在那里你可以找到许多XML文档,如:

  • clusterManifest
  • FabricHostSettings

要更改IPAddressOrFQDN,我已经替换了所有出现的单词' localhost' over' my.ip.address.here'。要修改的文件也更深入:

  • C:\SfDevCluster\Data\_Node_0\Fabric
  • C:\SfDevCluster\Data\_Node_0\Fabric\Fabric.Data
  • C:\SfDevCluster\Data\_Node_0\Fabric\Fabric.Config.0.0

enter image description here

更改之前

停止群集:

enter image description here

然后再次运行它:

enter image description here

还有另一种 - 更好的方法。您可以在目录C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup中更改生成脚本。

群集重置后,此设置将丢失。请记住,您自己承担风险,开发版本不安全,不应在生产环境中使用。

如果在中断后您无法连接到SF - 请确保防火墙不会阻止端口(您可以临时禁用防火墙)

答案 5 :(得分:0)

嘿,第一个答案(@ Varun Rathore 给出了)对我有用。但是,由于我试图在本地将容器部署在服务结构上,一次又一次从1节点群集切换到5节点群集,因此经常会出现此错误。因此,我要做的是以管理员的身份打开 powershell ,然后执行以下两个步骤。

  1. 首先转到以下路径

    cd“ C:\ Program Files \ Microsoft SDKs \ Service Fabric \ ClusterSetup”

  2. 第二次运行这两个文件

    。\ CleanCluster.ps1

    。\ DevClusterSetup.ps1

这将在本地计算机上设置1个节点群集。 您可以从服务矩阵群集管理器中执行此操作,但是它对我不起作用。每次修复vcredist_x64.exe文件并重新启动计算机(Windows 10 Pro)时,都感到沮丧。这对我有用。