排除本地开发群集安装的故障Troubleshoot your local development cluster setup

如果在与本地 Azure Service Fabric 开发群集交互时遇到问题,请查看以下建议以获得可能的解决方案。If you run into an issue while interacting with your local Azure Service Fabric development cluster, review the following suggestions for potential solutions.

群集安装失败Cluster setup failures

无法清除 Service Fabric 日志Cannot clean up Service Fabric logs

问题Problem

在运行 DevClusterSetup 脚本时,可看到以下错误:While running the DevClusterSetup script, you see the following error:

Cannot clean up C:\SfDevCluster\Log fully as references are likely being held to items in it. Please remove those and run this script again.
At line:1 char:1 + .\DevClusterSetup.ps1
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,DevClusterSetup.ps1

解决方案Solution

关闭当前 PowerShell 窗口,并以管理员身份打开一个新的 PowerShell 窗口。Close the current PowerShell window and open a new PowerShell window as an administrator. 现在可成功运行脚本。You can now successfully run the script.

群集连接失败Cluster connection failures

类型初始化异常Type Initialization exception

问题Problem

在 PowerShell 中连接到群集时,会看到针对 System.Fabric.Common.AppTrace 的 TypeInitializationException 错误。When you are connecting to the cluster in PowerShell, you see the error TypeInitializationException for System.Fabric.Common.AppTrace.

解决方案Solution

在安装期间未正确设置路径变量。Your path variable was not correctly set during installation. 从 Windows 注销并重新登录。Sign out of Windows and sign back in. 这将刷新你的路径。This refreshes your path.

群集连接失败,并显示“对象已关闭”Cluster connection fails with "Object is closed"

问题Problem

对 Connect-ServiceFabricCluster 的调用失败,并显示类似下面的错误:A call to Connect-ServiceFabricCluster fails with an error like this:

Connect-ServiceFabricCluster : The object is closed.
At line:1 char:1
+ Connect-ServiceFabricCluster
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricObjectClosedException
+ FullyQualifiedErrorId : CreateClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster

解决方案Solution

关闭当前 PowerShell 窗口,并以管理员身份打开一个新的 PowerShell 窗口。Close the current PowerShell window and open a new PowerShell window as an administrator.

结构连接被拒绝异常Fabric Connection Denied exception

问题Problem

从 Visual Studio 调试时,系统出现 FabricConnectionDeniedException 错误。When debugging from Visual Studio, you get a FabricConnectionDeniedException error.

解决方案Solution

尝试手动启动服务主机进程时,通常会出现此错误。This error usually occurs when you try to start a service host process manually.

确保在解决方案中没有将任何服务项目设置为启动项目。Ensure that you do not have any service projects set as startup projects in your solution. 只应将 Service Fabric 应用程序项目设置为启动项目。Only Service Fabric application projects should be set as startup projects.

提示

如果本地群集在设置后开始出现异常行为,则可使用本地群集管理器系统托盘应用程序来重置它。If, following setup, your local cluster begins to behave abnormally, you can reset it using the local cluster manager system tray application. 该操作将删除现有群集并设置一个新群集。This removes the existing cluster and set up a new one. 注意,所有部署的应用程序和关联的数据都会被删除。Note that all deployed applications and associated data is removed.

后续步骤Next steps