Azure Service Fabric回滚 [英] Azure Service Fabric Rollback

查看:64
本文介绍了Azure Service Fabric回滚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Service Fabric应用程序.假设是1.0.0版.我将更新部署为版本2.0.0.一切都很好.

I have a Service Fabric application. Let's say, version 1.0.0. I deploy an update as version 2.0.0. Everything is good.

稍后,我想回滚(或根据您的观点进行升级)到1.0.0版.

Later, I want to roll back (or upgrade depending on your perspective) to version 1.0.0.

我想运行一个简单的 PS 脚本进行回滚.

I want to run a simple PS script to rollback.

我知道有人曾问过类似的问题(以各种形式),但没有人提供解决方案.似乎有些普通的事情应该是微不足道的.我不需要有关发布方式的教程. 我只希望我可以运行一些PS脚本来进行回滚.

I know similar questions has been asked (in various forms), but no one has provided a solution. It seems like something common which should be trivial to accomplish. I don't need a tutorial on how publish works. I just want some PS script I can run to do the rollback.

运行5.5,我尝试了Start-ServiceFabricApplicationUpgrade的排列.

Running 5.5, I have tried permutations of Start-ServiceFabricApplicationUpgrade.

通常,这会导致以下形式的错误:

Most commonly, this result in an error of the following form:

Start-ServiceFabricApplicationUpgrade:不能在升级过程中修改默认服务描述.修改的 默认服务:结构:/xxx.要允许它,请将EnableDefaultServicesUpgrade设置为 是的.

Start-ServiceFabricApplicationUpgrade : Default service descriptions can not be modified as part of upgrade. Modified default service: fabric:/xxx. To allow it, set EnableDefaultServicesUpgrade to true.

我真的不想摆弄内部设置一些开关.文档是如此有限,以至于我什至在不冒我的结构完整性的风险的情况下甚至无法弄清楚该怎么做.而且,我完全不知道如何更改本地结构以获取此设置.

I really don't want to fiddle with internals to set some switch. The documentation is so limited that I can't even figure out exactly what do without risking the integrity of my fabric. And, I've no clue at all how I would change my local fabric to get this setting.

有人可以给我一个简单的PS脚本来完成此任务吗?

Can anybody give me just a straight forward PS script to accomplish this task?

推荐答案

借用几个答案,我想出了以下脚本,该脚本似乎在我测试过的所有情况下都有效.

Borrowing on several answers, I came up with the following script which seems to work in all cases where I have tested it.

Connect-ServiceFabricCluster
$app = Get-ServiceFabricApplication -ApplicationName "fabric:/xxx"
$table = @{}
$app.ApplicationParameters | ForEach-Object { $table.Add($_.Name, $_.Value) }
Start-ServiceFabricApplicationUpgrade -ApplicationName "fabric:/xxx" -ApplicationTypeVersion 1.0.0 -HealthCheckStableDurationSec 60 -UpgradeDomainTimeoutSec 1200 -UpgradeTimeout 3000   -FailureAction Rollback -Monitored -ApplicationParameter $table

这篇关于Azure Service Fabric回滚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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