Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect-ServiceFabricCluster fails to contact naming server on remote Azure Service Fabric cluster

I provisioned an Azure Service Fabric cluster in North Central US. I was able to initially publish my Service Fabric application to the cluster using Visual Studio and everything was running fine. I am now trying to upgrade the application via another Visual Studio publish, but the publish upgrade always fails with an Operation Timed Out error.

Alternatively, I tried to just connect to the Service Fabric cluster using Powershell. I can't seem to do that either as I get the following failure to connect to the Naming Service.

How do I get things working again?

PS C:\WINDOWS\system32> Connect-ServiceFabricCluster @connectArgs WARNING: Failed to contact Naming Service. Attempting to contact Failover Manager Service... WARNING: Failed to contact Failover Manager Service, Attempting to contact FMM... False Connect-ServiceFabricCluster : One or more errors occurred. At line:1 char:1 + Connect-ServiceFabricCluster @connectArgs + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Connect-ServiceFabricCluster], AggregateException + FullyQualifiedErrorId : CreateClusterConnectionErrorId,Microsoft.ServiceFabric.Powershell.ConnectCluster

like image 807
Aaron Schnieder Avatar asked Apr 13 '16 03:04

Aaron Schnieder


People also ask

What is Service Fabric Connect-servicefabriccluster?

The Connect-ServiceFabricCluster cmdlet creates a connection to a standalone Service Fabric cluster that allows you to run management actions for that cluster. After you connect to a cluster, you can view the settings of the connection by using the Get-ServiceFabricClusterConnection cmdlet.

How do I connect to an unsecure Azure service fabric cluster?

To connect to an unsecure cluster, provide the cluster endpoint address to the Connect-ServiceFabricCluster command: To connect to a secure cluster that uses Azure Active Directory to authorize cluster administrator access, provide the cluster certificate thumbprint and use the AzureActiveDirectory flag.

What happened to connect-servicefabriccluster PowerShell command?

After running " Reset local cluster " using the task tray icon for a local Service Fabric cluster the Connect-ServiceFabricCluster powershell command is no longer able to connect to the cluster in a powershell window where that command previously succeeded.

What is Azure service fabric PowerShell module?

Azure Service Fabric Module enables you to do operations like creating a managed cluster, scaling a node type, and viewing managed cluster resource information. The specific cmdlets supported for managed clusters are named AzServiceFabricManagedCluster* that you can reference on the Az.ServiceFabric PowerShell Module documentation.


1 Answers

I was getting the same error in PowerShell and this is what worked for me: (based on https://blogs.msdn.microsoft.com/ncdevguy/2016/12/25/connecting-to-a-remote-azure-service-fabric-cluster-using-powershell/)

$clusterFQDN = <your_cluster_FQDN>
$clusterEndpoint = $clusterFQDN+':19000'
$certThumbprint = (Get-ChildItem -Path Cert:\CurrentUser\My | where {$_.Subject -like "*$clusterFQDN*" }).Thumbprint
Connect-ServiceFabricCluster -ConnectionEndpoint $clusterEndpoint -KeepAliveIntervalInSec 10 -X509Credential -ServerCertThumbprint $certThumbprint -FindType FindByThumbprint -FindValue $certThumbprint -StoreLocation CurrentUser -StoreName My

NOTE: The KeepAliveIntervalInSec parameter is optional but the rest are mandatory.

NOTE: This assumes your management cert is installed in CurrentUser\My (Current User->Personal in Certificates MMC Snap-in).

Since the OP didn't specify what @connectArgs was, cannot be sure if my answer has been tried by the OP or not.

like image 159
Rim Avatar answered Sep 18 '22 19:09

Rim