问题描述

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

参考资料

Connect-ServiceFabricClusterhttps://docs.microsoft.com/zh-cn/powershell/module/servicefabric/connect-servicefabriccluster?view=azureservicefabricps&preserve-view=true&viewFallbackFrom=azureservicefabricpshttps%3A%2F%2Fdocs.microsoft.com%2Fpowershell%2Fmodule%2Faz.resources%2Fremove-azresource%3Fview%3Dazps-2.5.0

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 问题分析的更多相关文章

  1. 【Azure微服务 Service Fabric 】使用az命令创建Service Fabric集群

    问题描述 在使用Service Fabric的快速入门文档: 将 Windows 容器部署到 Service Fabric. 其中在创建Service Fabric时候,示例代码中使用的是PowerS ...

  2. 【Azure 微服务】Service Fabric, 使用ARM Template方式来更新SF集群的证书(Renew SF Certificate)

    问题描述 因证书过期导致Service Fabric集群挂掉(升级无法完成,节点不可用)一文中,描述了因为证书过期而导致了SF集群不可用,并且通过命令dd-AzServiceFabricCluster ...

  3. 【Azure微服务 Service Fabric 】Service Fabric中应用开启外部访问端口及微服务之间通过反向代理端口访问问题

    问题描述 1) 当成功的在Service Fabric集群中部署了应用后,如何来访问呢?如果是一个Web服务,它的URL又是什么呢? 2) 当Service Fabric集群中,服务之间如需要相互访问 ...

  4. 微服务架构中API网关的角色

    [上海尚学堂的话]:本文主要讲述了Mashape的首席技术执行官Palladino对API网关的详细介绍,以及API网关在微服务中所起的作用,同时介绍了Mashape的一款开源API网关Kong. A ...

  5. Chris Richardson微服务翻译:微服务架构中的服务发现

    Chris Richardson 微服务系列翻译全7篇链接: 微服务介绍 构建微服务之使用API网关 构建微服务之微服务架构的进程通讯 微服务架构中的服务发现(本文) 微服务之事件驱动的数据管理 微服 ...

  6. 微服务架构中APIGateway原理

    背景 我们知道在微服务架构风格中,一个大应用被拆分成为了多个小的服务系统提供出来,这些小的系统他们可以自成体系,也就是说这些小系统可以拥有自己的数据库,框架甚至语言等,这些小系统通常以提供 Rest ...

  7. 认证鉴权与API权限控制在微服务架构中的设计与实现(四)

    引言: 本文系<认证鉴权与API权限控制在微服务架构中的设计与实现>系列的完结篇,前面三篇已经将认证鉴权与API权限控制的流程和主要细节讲解完.本文比较长,对这个系列进行收尾,主要内容包括 ...

  8. JWT如何在Spring Cloud微服务系统中在服务相互调时传递

    转载请标明出处: http://blog.csdn.net/forezp/article/details/78676036 本文出自方志朋的博客 在微服务系统中,为了保证微服务系统的安全,常常使用jw ...

  9. 【CHRIS RICHARDSON 微服务系列】微服务架构中的进程间通信-3

    编者的话 |本文来自 Nginx 官方博客,是微服务系列文章的第三篇,在第一篇文章中介绍了微服务架构模式,与单体模式进行了比较,并且讨论了使用微服务架构的优缺点.第二篇描述了采用微服务架构的应用客户端 ...

随机推荐

  1. OpenStack Train版-12.创建虚拟网络并启动实例(控制节点)

    使用VMware虚拟机创建网络可能会有不可预测到的故障,可以通过dashboard界面,管理员创建admin用户的网络环境 1.第一种: 建立公共提供商网络在admin管理员用户下创建 source ...

  2. 5.Fanout交换机之新订单通知商户场景

    标题 : 5.Fanout交换机之新订单通知商户场景 目录 : RabbitMQ 序号 : 5 const string newOrderQueueName = "neworder-queu ...

  3. HEXO版本控制与持续集成

    主要解决了hexo发布文章的繁琐,以及本地资源丢失,更换电脑等情况的出现. 采用AppVeyor实现. 转自 https://formulahendry.github.io/2016/12/04/he ...

  4. codeforces 11B Jumping Jack

    Jack is working on his jumping skills recently. Currently he's located at point zero of the number l ...

  5. jupyter-notebook kernel died

    问题 在floydhub上跑个github上面的项目, 开了notebook模式运行, 一运行一会儿就kernel died了... 解决 我这儿的问题, 后来发现是出在: 在notebook中, 对 ...

  6. 手把手搭建一套私有 npm 服务

    手把手搭建一套私有 npm 服务 gnpm xnpm pnpm lnpm refs xgqfrms 2012-2020 www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!

  7. 正则表达式 test 踩坑指南

    正则表达式 test 踩坑指南 test 只能使用一次,第二次返回的是错误结果! reg = /edg|edge/g; /edg|edge/g reg.test(`edg`) true reg.tes ...

  8. SwiftUI error All In One

    SwiftUI error All In One Instance member xxx cannot be used on type yyy Instance member 'game' canno ...

  9. learning 2018

    learning 2018 https://scotch.io/courses https://laod.cn/hosts/ipv6-dns.html xgqfrms 2012-2020 www.cn ...

  10. 小程序 & taro 踩坑指南

    小程序 & taro 踩坑指南 微信开发者工具, 不支持 react bug https://github.com/NervJS/taro/issues/5042 solution just ...