简体   繁体   English

Azure Service Fabric回滚

[英]Azure Service Fabric Rollback

I have a Service Fabric application. 我有一个Service Fabric应用程序。 Let's say, version 1.0.0. 比方说,版本1.0.0。 I deploy an update as version 2.0.0. 我将更新部署为版本2.0.0。 Everything is good. 一切都是好的。

Later, I want to roll back (or upgrade depending on your perspective) to version 1.0.0. 稍后,我想回滚(或根据您的观点升级)到1.0.0版。

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. 我只想要一些我可以运行的PS脚本来做回滚。

Running 5.5, I have tried permutations of Start-ServiceFabricApplicationUpgrade. 运行5.5,我尝试了Start-ServiceFabricApplicationUpgrade的排列。

Most commonly, this result in an error of the following form: 最常见的是,这会导致以下形式的错误:

Start-ServiceFabricApplicationUpgrade : Default service descriptions can not be modified as part of upgrade. Start-ServiceFabricApplicationUpgrade:默认服务描述不能作为升级的一部分进行修改。 Modified default service: fabric:/xxx. 修改后的默认服务:fabric:/ xxx。 To allow it, set EnableDefaultServicesUpgrade to true. 要允许它,请将EnableDefaultServicesUpgrade设置为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. 并且,我完全不知道如何更改我的本地结构以获得此设置。

Can anybody give me just a straight forward PS script to accomplish this task? 任何人都可以给我一个直接的PS脚本来完成这项任务吗?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM