保持应用程序旧版本与Azure Service Fabric中的较新版本并行运行

Mur*_*rti 4 azure azure-service-fabric

我需要在Service Fabric上同时运行多个版本的应用程序.

1.0 1.1 ....

我需要将它们保持在线状态,而不是更新和替换版本.

可能吗?

谢谢!

Mur*_*rti 5

正如Matt Thalman所说,可以在Service Fabric集群中运行相同应用程序的不同版本.

我已经使用示例应用程序WordCount(http://aka.ms/servicefabric-wordcountapp)进行了测试.要查看有关下载应用程序和部署应用程序的更多详细信息,请参阅https://azure.microsoft.com/en-us/documentation/articles/service-fabric-get-started-with-a-local-cluster/

我已将WordCount复制为WordCountV1和WordCountV2.

然后我更改了/ApplicationManifest.xml以在每个包上具有不同的ApplicationTypeVersion.在Cluster Manager中显示App的当前版本是必要的,因为两个应用程序都按ApplicationTypeName分组显示.

V1

<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="WordCount" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
Run Code Online (Sandbox Code Playgroud)

V2

<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="WordCount" ApplicationTypeVersion="2.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
Run Code Online (Sandbox Code Playgroud)

然而,我已将/WordCountWebServicePkg/Code/wwwroot/index.html文件更改为在两个包上都有不同的内容.

有必要指定不同的端点,所以我更改了两个包中的文件/WordCountWebServicePkg/ServiceManifest.xml以响应不同的端口

V1

<Endpoint Name="ServiceEndpoint" Type="Input" Protocol="http" Port="8081" />
Run Code Online (Sandbox Code Playgroud)

V2

<Endpoint Name="ServiceEndpoint" Type="Input" Protocol="http" Port="8082" />
Run Code Online (Sandbox Code Playgroud)

最后一步是使用不同的ApplicationName来发布包:

V1

Publish-NewServiceFabricApplication -ApplicationPackagePath c:\ServiceFabric\WordCountV1.sfpkg -App
licationName "fabric:/WordCountV1"
Run Code Online (Sandbox Code Playgroud)

V2

Publish-NewServiceFabricApplication -ApplicationPackagePath c:\ServiceFabric\WordCountV2.sfpkg -App
licationName "fabric:/WordCountV2"
Run Code Online (Sandbox Code Playgroud)

这两个应用程序是并排发布的,我们可以通过它更好地控制版本更新.

V1

HTTP://本地主机:8081 /

V2

HTTP://本地主机:8082 /

希望能帮助到你!

PS:Azure Service Fabric文档团队,这个主题可以很好地在公共文档中