【Azure 微服务】PowerShell中,用Connect-ServiceFabricCluster命令无法连接到sf-test.chinaeast2.cloudapp.chinacloudapi.cn:19000 问题分析

问题描述
Azure Service Fabric提供了PowerShell的指令来进行创建,管理资源,如Get-ServiceFabricClusterHealth 获取当前集群的健康状态,但这些命令都需要使用Connect-ServiceFabricCluster 先连接到集群。而在使用连接命令时候,始终连接不成功。本且是运行PowerShell命令的机器上已经安装了SF的主要证书。通过添加 -debug命令查看输出结果,不能连接成功的原因为认证失败。[System.Fabric.FabricServerAuthenticationFailedException: FABRIC_E_SERVER_AUTHENTICATION_FAILED: 0x800b0109]

解决办法
在Service Fabric证书页面中,发现有安装主要证书,和次要证书,当主要证书认证失败时,尝试通过次要证书连接SF集群。发现通过次要证书成功连接。
根据次要证书可以登录成功,主要证书确不可以的情况,进一步的调研和测试,得出Azure Service Fabrics SDK 的默认证书加载行为是部署和使用过期日期最远的已定义证书,而不管其主要或次要配置定义如何。以下的测试为两个证书到期时间一样,使用PowerShell连接的时候也是会选择次要证书进行连接。如果需要让Service Fabrics使用主要证书,则可以在创建证书的时候,让主要证书的过期时间长一些。
主次证书信息(注意:过期时间一样)

主要证书连接失败

次要证书连接成功

附录一: 错误消息
警告: Failed to contact Failover Manager Service, Attempting to contact FMM...
False
详细信息: System.Fabric.FabricServerAuthenticationFailedException: FABRIC_E_SERVER_AUTHENTICATION_FAILED: 0x800b0109
---> System.Runtime.InteropServices.COMException: 异常来自 HRESULT:0x80071C44
在 System.Fabric.Interop.NativeClient.IFabricQueryClient11.EndGetPartitionList2(IFabricAsyncOperationContext
context)
在 System.Fabric.FabricClient.QueryClient.GetPartitionListAsyncEndWrapper(IFabricAsyncOperationContext context)
在 System.Fabric.Interop.AsyncCallOutAdapter2`1.Finish(IFabricAsyncOperationContext context, Boolean
expectedCompletedSynchronously)
--- 内部异常堆栈跟踪的结尾 ---
附录二:Connect-ServiceFabricCluster完整命令
Connect-ServiceFabricCluster -ConnectionEndpoint 'sf-test.chinaeast2.cloudapp.chinacloudapi.cn:19000' `
>> -KeepAliveIntervalInSec 10 `
>> -X509Credential -ServerCertThumbprint 'your thumbprint' `
>> -FindType FindByThumbprint -FindValue 'your thumbprint' `
>> -StoreLocation CurrentUser -StoreName My -debug
参考资料
The Connect-ServiceFabricCluster cmdlet creates a connection to a 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.
To manage Service Fabric clusters, start Windows PowerShell by using the Run as administrator option.
【Azure 微服务】PowerShell中,用Connect-ServiceFabricCluster命令无法连接到sf-test.chinaeast2.cloudapp.chinacloudapi.cn:19000 问题分析的更多相关文章
- 【Azure微服务 Service Fabric 】使用az命令创建Service Fabric集群
问题描述 在使用Service Fabric的快速入门文档: 将 Windows 容器部署到 Service Fabric. 其中在创建Service Fabric时候,示例代码中使用的是PowerS ...
- 【Azure 微服务】Service Fabric, 使用ARM Template方式来更新SF集群的证书(Renew SF Certificate)
问题描述 因证书过期导致Service Fabric集群挂掉(升级无法完成,节点不可用)一文中,描述了因为证书过期而导致了SF集群不可用,并且通过命令dd-AzServiceFabricCluster ...
- 【Azure微服务 Service Fabric 】Service Fabric中应用开启外部访问端口及微服务之间通过反向代理端口访问问题
问题描述 1) 当成功的在Service Fabric集群中部署了应用后,如何来访问呢?如果是一个Web服务,它的URL又是什么呢? 2) 当Service Fabric集群中,服务之间如需要相互访问 ...
- 微服务架构中API网关的角色
[上海尚学堂的话]:本文主要讲述了Mashape的首席技术执行官Palladino对API网关的详细介绍,以及API网关在微服务中所起的作用,同时介绍了Mashape的一款开源API网关Kong. A ...
- Chris Richardson微服务翻译:微服务架构中的服务发现
Chris Richardson 微服务系列翻译全7篇链接: 微服务介绍 构建微服务之使用API网关 构建微服务之微服务架构的进程通讯 微服务架构中的服务发现(本文) 微服务之事件驱动的数据管理 微服 ...
- 微服务架构中APIGateway原理
背景 我们知道在微服务架构风格中,一个大应用被拆分成为了多个小的服务系统提供出来,这些小的系统他们可以自成体系,也就是说这些小系统可以拥有自己的数据库,框架甚至语言等,这些小系统通常以提供 Rest ...
- 认证鉴权与API权限控制在微服务架构中的设计与实现(四)
引言: 本文系<认证鉴权与API权限控制在微服务架构中的设计与实现>系列的完结篇,前面三篇已经将认证鉴权与API权限控制的流程和主要细节讲解完.本文比较长,对这个系列进行收尾,主要内容包括 ...
- JWT如何在Spring Cloud微服务系统中在服务相互调时传递
转载请标明出处: http://blog.csdn.net/forezp/article/details/78676036 本文出自方志朋的博客 在微服务系统中,为了保证微服务系统的安全,常常使用jw ...
- 【CHRIS RICHARDSON 微服务系列】微服务架构中的进程间通信-3
编者的话 |本文来自 Nginx 官方博客,是微服务系列文章的第三篇,在第一篇文章中介绍了微服务架构模式,与单体模式进行了比较,并且讨论了使用微服务架构的优缺点.第二篇描述了采用微服务架构的应用客户端 ...
随机推荐
- 加密后的程序在Win8中无法运行
需要使用dotNET_Reactor 4.7以上的版本加密后才能在Win8中使用.
- sqlmap在https情况下的一个错误
对于https网站,使用sqlmap可能会出现如下错误.使用–force-ssl无效. https证书有问题 方法 本地建立proxy.php,内容为 <?php $url = "ht ...
- [USACO15JAN]Moovie Mooving G
[USACO15JAN]Moovie Mooving G 状压难题.不过也好理解. 首先我们根据题意: she does not want to ever visit the same movie t ...
- Apple & 人体工程学
Apple & 人体工程学 https://support.apple.com/zh-cn/HT205655 MBP 2018 https://help.apple.com/macbookpr ...
- Chinese Parents Game
Chinese Parents Game <中国式家长>是一款模拟养成游戏. 玩家在游戏中扮演一位出生在普通的中式家庭的孩子. https://en.wikipedia.org/wiki/ ...
- TypeScript Interface vs Types All In One
TypeScript Interface vs Types All In One TypeScript https://www.typescriptlang.org/docs/handbook/adv ...
- svg insert shape string bug
svg insert shape string bug not support custom areaProps attributes ??? const svg = document.querySe ...
- ts 遍历Class上的属性和方法
interface Type<T> extends Function { new (...args: any[]): T; } class Data { name = "ajan ...
- 教你玩转CSS 居中
1.元素居中对齐 要水平居中对齐一个元素(如 <div>), 可以使用 margin: auto;. 设置到元素的宽度将防止它溢出到容器的边缘. 元素通过指定宽度,并将两边的空外边距平均分 ...
- SSL/TLS协议详解(中)——证书颁发机构
本文转载自SSL/TLS协议详解(中)--证书颁发机构 导语 上一篇中,我们讨论了关于Diffie Hellman算法的SSL/TLS密钥交换.我们最终认为需要第三方来验证服务器的真实性,并提出了证书 ...