从服务矩阵群集中删除应用程序 [英] Removing application from service fabric cluster

查看:70
本文介绍了从服务矩阵群集中删除应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用Service Fabric资源管理器从Service Fabric中删除应用程序.

I tried removing application from service fabric using service fabric explorer.

我使用删除应用程序"操作删除了我的应用程序. 然后,当我尝试取消配置应用程序类型时,出现错误提示,

I deleted my application using Delete Application action. Then When I tried Unprovision application type I got error saying,

错误:不能将版本1.0.0的应用程序类型取消设置为 它仍然包含活动的应用程序.

Error: Application Type of version 1.0.0 could not be unprovisioned as it still contains active applications.

我可以看到,即使删除了应用程序,应用程序内部的actor服务在某些节点中仍然处于活动状态. 我附上了我的服务结构资源管理器的屏幕截图.

I could see that even after deleting the application , the actor service inside the application is still active in some of the nodes. Am attaching a screenshot of my service fabric explorer.

有关完全删除应用程序的任何帮助吗?

Any help regarding completely removing the applications?

推荐答案

如果您的应用程序中的服务在平台请求时未关闭就不能很好地运行,例如忽略了RunAsync中的取消令牌,则可能会发生这种情况.

This can happen if services in your application don't play nice by not shutting down when requested by the platform, for example by ignoring the cancellation token in RunAsync.

这是一个快速的PowerShell脚本,它将通过应用程序并强制删除所有有状态服务的所有副本:

Here's a quick PowerShell script that will go through an application and force remove all replicas of all stateful services:

Connect-ServiceFabricCluster -ConnectionEndpoint localhost:19000

$nodes = Get-ServiceFabricNode

foreach($node in $nodes)
{
    $replicas = Get-ServiceFabricDeployedReplica -NodeName $node.NodeName -ApplicationName "fabric:/MyApp"

    foreach ($replica in $replicas)
    {
        Remove-ServiceFabricReplica -ForceRemove -NodeName $node.NodeName -PartitionId $replica.Partitionid -ReplicaOrInstanceId $replica.ReplicaOrInstanceId
    }
}

这篇关于从服务矩阵群集中删除应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆