我可以自定义 azure service fabric vm 节点吗?
Can I customize azure service fabric vm nodes?
我想在 Azure 服务结构中利用可靠的参与者模型。我们的 actor 模型计算需要在 vm 节点上安装特定的软件。我可以在 vm 节点中安装自定义软件(在 azure service fabric 软件之上),以便我可以在 actor 模型计算中利用该软件吗?作为将我的参与者模型部署到 Azure Service Fabric 的一部分,我可以将此自定义软件安装编写到其中吗?这是应该做的吗?或者还有其他方法吗?或者有可能吗?
拉古/..
您是否尝试过将自定义软件部署为来宾可执行文件?
供参考:https://azure.microsoft.com/en-us/documentation/articles/service-fabric-deploy-existing-app/
您有多种选择:
在每台服务器上手动安装软件
如果您不经常更改服务器数量并且您的服务器数量不多,您可以直接通过 RDP 连接到每台服务器并手动安装您的软件。
运行 它作为 Service Fabric 中的一项单独服务
正如 JunRam 所说,您可以 运行 Service Fabric 中的来宾可执行文件。假设您的软件是一个没有安装程序的简单程序,您可以为其创建一个无状态服务包并将 InstanceCount 设置为 -1。这意味着,该服务将由 Service Fabric 放置在每个节点上。如果程序意外终止,Service Fabric 将自动重新启动该程序,并且还会在您横向扩展时将其放置在新节点上。
使用虚拟机扩展
Some software can be integrated directly into the ARM (Azure Resource Manager) template of your virtual machine. The default ARM template of Azure Service Fabric uses this mechanism to automatically install the "Azure Diagnostics" agent and the Service Fabric agent on each server. To get an ARM template for Service Fabric, you can either use a quickstart sample, use the Azure Portal wizard and export it right before you would create the cluster or export an existing resource group 作为模板。
还有一个Custom Script Extension that allows you to run a CMD or PowerShell script. Within such a script you could e.g. use Chocolatey, Boxstarter或者手动安装你的程序。
此方法的优势在于,它将软件作为基础架构部署的一部分进行安装,并且还会在您扩展集群时在每个新节点上自动安装软件。
使用 PowerShell DSC、Puppet、Chef 等自动化工具
如果您要安装的程序无法直接作为虚拟机扩展使用,并且无法使用 "Custom Script Extension" 安装,您可以使用 Azure Automation DSC (Desired State Configuration) to automate the installation of additional software on your nodes. DSC needs an agent on your virtual machines, which is available as a Virtual Machine Extension. There is an ARM-based template,它显示了如何集成扩展到虚拟机规模集中。您可以将此扩展包含在您的 Service Fabric ARM 模板中并重新部署它以在您的每个节点上安装该扩展。
在此之后,您可以使用 DSC 的 Package 功能来安装您的软件。
请注意,创建此解决方案可能需要大量时间。但是,PowerShell DSC 是一个非常强大的系统,一旦安装,就可以在服务器管理方面为您提供更多的可能性。
使用您自己的 VM 映像
您可以 capture and upload 虚拟机映像并将其用作 Service Fabric ARM 模板的基础映像。如果您需要在您的服务器上执行不容易自动化的步骤,这可能会很有用。
我想在 Azure 服务结构中利用可靠的参与者模型。我们的 actor 模型计算需要在 vm 节点上安装特定的软件。我可以在 vm 节点中安装自定义软件(在 azure service fabric 软件之上),以便我可以在 actor 模型计算中利用该软件吗?作为将我的参与者模型部署到 Azure Service Fabric 的一部分,我可以将此自定义软件安装编写到其中吗?这是应该做的吗?或者还有其他方法吗?或者有可能吗?
拉古/..
您是否尝试过将自定义软件部署为来宾可执行文件?
供参考:https://azure.microsoft.com/en-us/documentation/articles/service-fabric-deploy-existing-app/
您有多种选择:
在每台服务器上手动安装软件
如果您不经常更改服务器数量并且您的服务器数量不多,您可以直接通过 RDP 连接到每台服务器并手动安装您的软件。
运行 它作为 Service Fabric 中的一项单独服务
正如 JunRam 所说,您可以 运行 Service Fabric 中的来宾可执行文件。假设您的软件是一个没有安装程序的简单程序,您可以为其创建一个无状态服务包并将 InstanceCount 设置为 -1。这意味着,该服务将由 Service Fabric 放置在每个节点上。如果程序意外终止,Service Fabric 将自动重新启动该程序,并且还会在您横向扩展时将其放置在新节点上。
使用虚拟机扩展
Some software can be integrated directly into the ARM (Azure Resource Manager) template of your virtual machine. The default ARM template of Azure Service Fabric uses this mechanism to automatically install the "Azure Diagnostics" agent and the Service Fabric agent on each server. To get an ARM template for Service Fabric, you can either use a quickstart sample, use the Azure Portal wizard and export it right before you would create the cluster or export an existing resource group 作为模板。
还有一个Custom Script Extension that allows you to run a CMD or PowerShell script. Within such a script you could e.g. use Chocolatey, Boxstarter或者手动安装你的程序。
此方法的优势在于,它将软件作为基础架构部署的一部分进行安装,并且还会在您扩展集群时在每个新节点上自动安装软件。
使用 PowerShell DSC、Puppet、Chef 等自动化工具
如果您要安装的程序无法直接作为虚拟机扩展使用,并且无法使用 "Custom Script Extension" 安装,您可以使用 Azure Automation DSC (Desired State Configuration) to automate the installation of additional software on your nodes. DSC needs an agent on your virtual machines, which is available as a Virtual Machine Extension. There is an ARM-based template,它显示了如何集成扩展到虚拟机规模集中。您可以将此扩展包含在您的 Service Fabric ARM 模板中并重新部署它以在您的每个节点上安装该扩展。
在此之后,您可以使用 DSC 的 Package 功能来安装您的软件。
请注意,创建此解决方案可能需要大量时间。但是,PowerShell DSC 是一个非常强大的系统,一旦安装,就可以在服务器管理方面为您提供更多的可能性。
使用您自己的 VM 映像
您可以 capture and upload 虚拟机映像并将其用作 Service Fabric ARM 模板的基础映像。如果您需要在您的服务器上执行不容易自动化的步骤,这可能会很有用。