Powershell 为什么可以';我是否连接到此服务结构群集?

Powershell 为什么可以';我是否连接到此服务结构群集?,powershell,azure,azure-service-fabric,ports,windows-firewall,Powershell,Azure,Azure Service Fabric,Ports,Windows Firewall,在使用网络连接虚拟机的PowerShell命令连接到本地运行的远程服务结构群集(而不是Azure上的)时,我被错误阻止: WARNING: Failed to contact Naming Service. Attempting to contact Failover Manager Service... WARNING: Failed to contact Failover Manager Service, Attempting to contact FMM... False WARNING:

在使用网络连接虚拟机的PowerShell命令连接到本地运行的远程服务结构群集(而不是Azure上的)时,我被错误阻止:

WARNING: Failed to contact Naming Service. Attempting to contact Failover Manager Service...
WARNING: Failed to contact Failover Manager Service, Attempting to contact FMM...
False
WARNING: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 192.168.1.102:19000
Connect-ServiceFabricCluster : No cluster endpoint is reachable, please check if there is connectivity/firewall/DNS issue.
At Install.ps1:3 char:1
+ Connect-ServiceFabricCluster -ConnectionEndpoint "FABRICTESTSRV:19000" -WindowsCred ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Connect-ServiceFabricCluster], FabricException
    + FullyQualifiedErrorId : TestClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster
命令是:

Connect-ServiceFabricCluster -ConnectionEndpoint "FABRICTESTSRV:19000" -WindowsCredential:$True
为什么不起作用

以下是我尝试过的:

  • 我已尝试完全关闭Windows防火墙。那里运气不好
  • 在虚拟机内部本地连接到群集运行正常:
    connectservicefactriccluster“localhost:19000”
  • 这不是DNS问题。我可以ping机器的FQDN
注意:这不是Azure托管的虚拟机。这只是一个运行Service Fabric Core的网络连接虚拟机,Windows 8.1 x64完全是最新的

编辑
获取ServiceFabricClusterManifest
内容如下:

<ClusterManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="ComputerName-Local-Cluster" Version=
"1.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <NodeTypes>
    <NodeType Name="NodeType0">
      <Endpoints>
        <ClientConnectionEndpoint Port="19000" />
        <LeaseDriverEndpoint Port="19001" />
        <ClusterConnectionEndpoint Port="19002" />
        <HttpGatewayEndpoint Port="19080" Protocol="http" />
        <HttpApplicationGatewayEndpoint Port="19081" Protocol="http" />
        <ServiceConnectionEndpoint Port="19006" />
        <ApplicationEndpoints StartPort="30001" EndPort="31000" />
      </Endpoints>
    </NodeType>
    <NodeType Name="NodeType1">
      <Endpoints>
        <ClientConnectionEndpoint Port="19010" />
        <LeaseDriverEndpoint Port="19011" />
        <ClusterConnectionEndpoint Port="19012" />
        <HttpGatewayEndpoint Port="19082" Protocol="http" />
        <HttpApplicationGatewayEndpoint Port="19083" Protocol="http" />
        <ServiceConnectionEndpoint Port="19016" />
        <ApplicationEndpoints StartPort="31001" EndPort="32000" />
      </Endpoints>
    </NodeType>
    <NodeType Name="NodeType2">
      <Endpoints>
        <ClientConnectionEndpoint Port="19020" />
        <LeaseDriverEndpoint Port="19021" />
        <ClusterConnectionEndpoint Port="19022" />
        <HttpGatewayEndpoint Port="19084" Protocol="http" />
        <HttpApplicationGatewayEndpoint Port="19085" Protocol="http" />
        <ServiceConnectionEndpoint Port="19026" />
        <ApplicationEndpoints StartPort="32001" EndPort="33000" />
      </Endpoints>
    </NodeType>
    <NodeType Name="NodeType3">
      <Endpoints>
        <ClientConnectionEndpoint Port="19030" />
        <LeaseDriverEndpoint Port="19031" />
        <ClusterConnectionEndpoint Port="19032" />
        <HttpGatewayEndpoint Port="19086" Protocol="http" />
        <HttpApplicationGatewayEndpoint Port="19087" Protocol="http" />
        <ServiceConnectionEndpoint Port="19036" />
        <ApplicationEndpoints StartPort="33001" EndPort="34000" />
      </Endpoints>
    </NodeType>
    <NodeType Name="NodeType4">
      <Endpoints>
        <ClientConnectionEndpoint Port="19040" />
        <LeaseDriverEndpoint Port="19041" />
        <ClusterConnectionEndpoint Port="19042" />
        <HttpGatewayEndpoint Port="19088" Protocol="http" />
        <HttpApplicationGatewayEndpoint Port="19089" Protocol="http" />
        <ServiceConnectionEndpoint Port="19046" />
        <ApplicationEndpoints StartPort="34001" EndPort="35000" />
      </Endpoints>
    </NodeType>
  </NodeTypes>
  <Infrastructure>
    <WindowsServer IsScaleMin="true">
      <NodeList>
        <Node NodeName="_Node_0" IPAddressOrFQDN="localhost" IsSeedNode="true" NodeTypeRef="NodeType0" FaultDomain="fd:/0" UpgradeDomain="0" />
        <Node NodeName="_Node_1" IPAddressOrFQDN="localhost" IsSeedNode="true" NodeTypeRef="NodeType1" FaultDomain="fd:/1" UpgradeDomain="1" />
        <Node NodeName="_Node_2" IPAddressOrFQDN="localhost" IsSeedNode="true" NodeTypeRef="NodeType2" FaultDomain="fd:/2" UpgradeDomain="2" />
        <Node NodeName="_Node_3" IPAddressOrFQDN="localhost" NodeTypeRef="NodeType3" FaultDomain="fd:/3" UpgradeDomain="3" />
        <Node NodeName="_Node_4" IPAddressOrFQDN="localhost" NodeTypeRef="NodeType4" FaultDomain="fd:/4" UpgradeDomain="4" />
      </NodeList>
    </WindowsServer>
  </Infrastructure>
  <FabricSettings>
    <Section Name="Security">
      <Parameter Name="ClusterCredentialType" Value="None" />
      <Parameter Name="ServerAuthCredentialType" Value="None" />
    </Section>
    <Section Name="FailoverManager">
      <Parameter Name="ExpectedClusterSize" Value="4" />
      <Parameter Name="TargetReplicaSetSize" Value="3" />
      <Parameter Name="MinReplicaSetSize" Value="3" />
      <Parameter Name="ReconfigurationTimeLimit" Value="20" />
      <Parameter Name="BuildReplicaTimeLimit" Value="20" />
      <Parameter Name="CreateInstanceTimeLimit" Value="20" />
      <Parameter Name="PlacementTimeLimit" Value="20" />
    </Section>
    <Section Name="ReconfigurationAgent">
      <Parameter Name="ServiceApiHealthDuration" Value="20" />
      <Parameter Name="ServiceReconfigurationApiHealthDuration" Value="20" />
      <Parameter Name="LocalHealthReportingTimerInterval" Value="5" />
      <Parameter Name="IsDeactivationInfoEnabled" Value="true" />
      <Parameter Name="RAUpgradeProgressCheckInterval" Value="3" />
    </Section>
    <Section Name="ClusterManager">
      <Parameter Name="TargetReplicaSetSize" Value="3" />
      <Parameter Name="MinReplicaSetSize" Value="3" />
      <Parameter Name="UpgradeStatusPollInterval" Value="5" />
      <Parameter Name="UpgradeHealthCheckInterval" Value="5" />
      <Parameter Name="FabricUpgradeHealthCheckInterval" Value="5" />
    </Section>
    <Section Name="NamingService">
      <Parameter Name="TargetReplicaSetSize" Value="3" />
      <Parameter Name="MinReplicaSetSize" Value="3" />
    </Section>
    <Section Name="Management">
      <Parameter Name="ImageStoreConnectionString" Value="file:C:\SfDevCluster\Data\ImageStoreShare" />
      <Parameter Name="ImageCachingEnabled" Value="false" />
      <Parameter Name="EnableDeploymentAtDataRoot" Value="true" />
    </Section>
    <Section Name="Hosting">
      <Parameter Name="EndpointProviderEnabled" Value="true" />
      <Parameter Name="RunAsPolicyEnabled" Value="true" />
      <Parameter Name="DeactivationScanInterval" Value="60" />
      <Parameter Name="DeactivationGraceInterval" Value="10" />
      <Parameter Name="EnableProcessDebugging" Value="true" />
      <Parameter Name="ServiceTypeRegistrationTimeout" Value="20" />
      <Parameter Name="CacheCleanupScanInterval" Value="300" />
    </Section>
    <Section Name="HttpGateway">
      <Parameter Name="IsEnabled" Value="true" />
    </Section>
    <Section Name="PlacementAndLoadBalancing">
      <Parameter Name="MinLoadBalancingInterval" Value="300" />
    </Section>
    <Section Name="Federation">
      <Parameter Name="NodeIdGeneratorVersion" Value="V4" />
      <Parameter Name="UnresponsiveDuration" Value="0" />
    </Section>
    <Section Name="ApplicationGateway/Http">
      <Parameter Name="IsEnabled" Value="true" />
    </Section>
    <Section Name="FaultAnalysisService">
      <Parameter Name="TargetReplicaSetSize" Value="3" />
      <Parameter Name="MinReplicaSetSize" Value="3" />
    </Section>
    <Section Name="Trace/Etw">
      <Parameter Name="Level" Value="4" />
    </Section>
    <Section Name="Diagnostics">
      <Parameter Name="ProducerInstances" Value="ServiceFabricEtlFile, ServiceFabricPerfCtrFolder" />
      <Parameter Name="MaxDiskQuotaInMB" Value="10240" />
    </Section>
    <Section Name="ServiceFabricEtlFile">
      <Parameter Name="ProducerType" Value="EtlFileProducer" />
      <Parameter Name="IsEnabled" Value="true" />
      <Parameter Name="EtlReadIntervalInMinutes" Value=" 5" />
      <Parameter Name="DataDeletionAgeInDays" Value="3" />
    </Section>
    <Section Name="ServiceFabricPerfCtrFolder">
      <Parameter Name="ProducerType" Value="FolderProducer" />
      <Parameter Name="IsEnabled" Value="true" />
      <Parameter Name="FolderType" Value="ServiceFabricPerformanceCounters" />
      <Parameter Name="DataDeletionAgeInDays" Value="3" />
    </Section>
    <Section Name="TransactionalReplicator">
      <Parameter Name="CheckpointThresholdInMB" Value="64" />
    </Section>
  </FabricSettings>
</ClusterManifest>

有一些问题,但正如@cassandrad提到的,最大的问题是默认部署绑定到本地主机的TCP FQDN(
IPAddressOrFQDN=“localhost”
)而不是机器的IP地址,因此默认情况下它只允许本地连接

以下是解决我的问题的完整步骤:

  • 我首先在命令提示符下运行netstat-a | FindStr“19000”,检查哪些绑定处于活动状态,以确认@cassandrad所说的内容
  • 读了这篇文章后,我决定下载(顺便说一句,在Windows 8.1 x64上,在Windows Server之外工作正常)
  • 我复制并修改了
    ClusterConfig.Unsecure.DevCluster.json
    ,在
    nodes
    部分下,我将所有节点的
    iPAddress
    更改为
    192.168.1.102
    。我调用了新文件
    ClusterConfig.Unsecure.CustomDevCluster.json
  • 我运行了
    CreateServiceFabricCluster.ps1
    。它问我要使用什么JSON配置,所以我给了它
    ClusterConfig.Unsecure.DevCluster.JSON
  • 第一次失败是因为在获取
    Newtonsoft.JSON
    version
    6.0.0.0
    时出错,从跟踪中可以看出,这是一个相当恼人的模糊错误。这个错误是因为我没有.NETFramework 4.6.2,所以我安装了它
  • 第二次失败是因为安装了
    Microsoft Azure Service Fabric
    MSI。出现此错误是因为我以前安装过。我转到程序和功能并卸载了
    Microsoft Azure Service Fabric
    (我没有安装
    Microsoft Azure Service Fabric SDK
  • 我最后一次运行脚本,祈求好运,它终于成功了
  • 它是一个不安全的集群,因此我可以使用
    connectservicefactriccluster“192.168.1.102:19000”
    简单地连接到它。如果要启用其他身份验证机制,请修改并使用一些其他
    .json
    示例配置

有一些问题,但正如@cassandrad提到的,最大的问题是默认部署绑定到本地主机的TCP FQDN(
IPAddressOrFQDN=“localhost”
)而不是机器的IP地址,因此默认情况下它只允许本地连接

以下是解决我的问题的完整步骤:

  • 我首先在命令提示符下运行netstat-a | FindStr“19000”,检查哪些绑定处于活动状态,以确认@cassandrad所说的内容
  • 读了这篇文章后,我决定下载(顺便说一句,在Windows 8.1 x64上,在Windows Server之外工作正常)
  • 我复制并修改了
    ClusterConfig.Unsecure.DevCluster.json
    ,在
    nodes
    部分下,我将所有节点的
    iPAddress
    更改为
    192.168.1.102
    。我调用了新文件
    ClusterConfig.Unsecure.CustomDevCluster.json
  • 我运行了
    CreateServiceFabricCluster.ps1
    。它问我要使用什么JSON配置,所以我给了它
    ClusterConfig.Unsecure.DevCluster.JSON
  • 第一次失败是因为在获取
    Newtonsoft.JSON
    version
    6.0.0.0
    时出错,从跟踪中可以看出,这是一个相当恼人的模糊错误。这个错误是因为我没有.NETFramework 4.6.2,所以我安装了它
  • 第二次失败是因为安装了
    Microsoft Azure Service Fabric
    MSI。出现此错误是因为我以前安装过。我转到程序和功能并卸载了
    Microsoft Azure Service Fabric
    (我没有安装
    Microsoft Azure Service Fabric SDK
  • 我最后一次运行脚本,祈求好运,它终于成功了
  • 它是一个不安全的集群,因此我可以使用
    connectservicefactriccluster“192.168.1.102:19000”
    简单地连接到它。如果要启用其他身份验证机制,请修改