从可视stuido或Service Fabric资源管理器将Service Fabric回滚到以前的版本 [英] Service fabric rollback to previous version from visual stuido or service fabric explorer

查看:139
本文介绍了从可视stuido或Service Fabric资源管理器将Service Fabric回滚到以前的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已通过Visual Studio发布将服务结构应用程序版本1.25.0发布到本地群集以及Azure中的群集.一切正常.

I have published service fabric application version 1.25.0 to the local cluster as well as a cluster in Azure through visual studio publish. All worked.

Visual Studio也使我可以选择升级应用程序.但是我无法找到如何回滚和发布我的应用程序的先前版本,比如说Visual Studio中的1.23.0.

Visual studio gives me the option to upgrade the application too. But I could not able to find how to rollback and publish the previous version of my application let's say 1.23.0 from visual studio.

如果无法从Visual Studio中进行操作,是否可以通过Service Fabric资源管理器进行操作?

If it cannot be possible from the Visual studio is it possible to do it from service fabric explorer?

我见过类似 Azure Service Fabric回滚之类的帖子,但它们与PowerShell脚本有关希望从Visual Studio或Service Fabric资源管理器中进行回滚之后.

I have seen posts like Azure Service Fabric Rollback but they are related to PowerShell scripts I am more after looking to rollback from visual studio or service fabric explorer.

推荐答案

没有用于回滚或升级的 Service Fabric资源管理器选项或按钮,在部署中需要注意一些事项注意正确使用回滚",如果只是一个按钮,则会增加犯错的机会.

There is no Service Fabric Explorer option or buttons to make rollbacks or upgrades, There are some caveats in the deployment that you must pay attention to correctly use the Rollback, if it was just a button, it would increase the chances of making mistakes.

使用脚本进行回滚并不那么复杂,您应该只需要几行代码就可以了,就像您链接的答案中提供的选项一样.

The rollback using scripts are not that complex, you should be able to to with just a few lines of code like the option provided in the answer you linked.

此外,回滚很简单,但在某些情况下可能很复杂,例如,更改现有服务的配置,备份,还原等,使用脚本make做一个UI来处理许多情况会很棘手.它更加灵活和动态.今天的脚本很简单,但是如果将来要添加新功能,就不需要太多更改来支持它.

Also, rollback is simple to do but can be complex in some scenarios, for example, changing the configuration of existing services, backups, restores and so on, would be tricky to do an UI to handle many scenarios, using scripts make it more flexible and dynamic. Today the scripts are simple, but in case new features are added in the future, it wouldn't need many changes to support it.

关于方案,您可以使用其他方法,例如:

Regarding the scenarios, you could make use of other approaches like:

第一种情况是: 部署成功,但应用程序行为不正常

The first scenario is: Deployment is successful but application is not behaving correctly

当成功部署新版本,服务运行没有错误,但应用程序有错误或无法正常工作时,这种情况很常见.

This scenario is very common when the new version is successfully deployed, the service runs without errors, but the application has bugs or does not work as expect.

要回滚到以前的版本,必须升级该应用程序并确定先前部署的应用程序版本.只是一个简单的升级命令,不幸的是,某处没有存储以前的版本",您必须在某个地方跟踪以前的版本,以便可以找到以前的版本.

To rollback to a previous version you must upgrade the application and target the Application Version deployed previously. Is just a simple upgrade command, unfortunately there is no "Previous Version" stored somewhere, you have to keep track of previous versions somewhere so that you can find the previous versions.

该命令必须手动运行,例如:

The command must be run manually like:

Start-ServiceFabricApplicationUpgrade -ApplicationName fabric:/VisualObjects -ApplicationTypeVersion 2.0.0.0 -HealthCheckStableDurationSec 60 -UpgradeDomainTimeoutSec 1200 -UpgradeTimeout 3000 -FailureAction Rollback -Monitored

脚本Deploy-FabricApplication.ps1具有用于从ServiceFabric Image存储中删除较旧版本的参数UnregisterUnusedApplicationVersionsAfterUpgrade,如果使用此方法,则应避免使用,因为必须将较旧版本复制到SF,然后应用升级,以防出现以下情况:需要回滚.一种更好的方法是实现一种算法,该算法每晚执行一次,或者在发布后运行,并删除旧版本并保留最后N个.

The script Deploy-FabricApplication.ps1 have a parameter UnregisterUnusedApplicationVersionsAfterUpgrade that removes older versions from ServiceFabric Image store, if you use this approach you should avoid, because you have to copy the older version to SF and then apply the upgrade in case a rollback is needed. A better approach is implement an algorithm that runs nightly or after releases and remove old versions and keep the last N.

.

另一种情况是: 升级期间服务失败

The other scenario is: Service failure during upgrade

在这种情况下,由于Service Fabric会为您处理,因此更易于处理,因此,当您开始升级时,可以选择使其 自动 手册 .

In this case is easier to handle, because Service Fabric handles it for you, when you start the upgrade you have the option to make it automatic or manual.

在自动模式下,如果服务在启动时失败,则Service Fabric将看到它并重试几次,以防该问题持续存在,它将自动回滚到服务,并将应用程序自动回滚到以前的版本.

In the automatic, if a service fails on startup, Service Fabric will see it and retry a few times, in case it persists, it will rollback to the service and the application to previous version automatically.

在手动模式下,Service Fabric将启动部署,但不会执行任何操作,您应该运行脚本以将部署继续到下一个阶段或回滚.如果您具有非常敏感的服务,并且更新需要特别注意,主要是为了验证行为并在继续进行部署之前进行手动测试,则此方法很方便.

In the manual mode, Service Fabric will start the deployment, but won't take any action, and you should run scripts to continue the deployment to next stages or rollback. This approach is convenient if you have very sensitive services and updates need an extra caution, mainly to validate the behaviour and do manual tests before you continue with the deployment.

可以找到这些设置这里

这篇关于从可视stuido或Service Fabric资源管理器将Service Fabric回滚到以前的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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