[英]How to shutdown one instance of an app service in azure
I have deployd an Asp.Net MVC application to an app service in azure and scaled it out to 2 instances.我已将 Asp.Net MVC 应用程序部署到 azure 中的应用程序服务并将其扩展到 2 个实例。
Sometimes I need to restart an instance, but I only find a way to restart the whole web app.有时我需要重启一个实例,但我只是想办法重启整个 web 应用程序。 Is there a way to restart one instance only?
有没有办法只重启一个实例? Even removing the instance and then creating a new one would work for me.
即使删除实例然后创建一个新实例也对我有用。
There is no super clean way to do this, but it is still possible to achieve with the following steps:没有超级干净的方法可以做到这一点,但仍然可以通过以下步骤实现:
You can now restart an instance of an App Service Plan from the App Service Plans - Reboot Worker page in the Azure docs.您现在可以从 Azure 文档中的App Service Plans - Reboot Worker页面重新启动 App Service Plan 的实例。 You can restart the instance directly from that page using the 'Try it' feature.
您可以使用“试用”功能直接从该页面重新启动实例。
If you are using App Services then, unfortunately, this is not possible.如果您使用的是应用服务,那么很遗憾,这是不可能的。 You can only update the no.
您只能更新编号。 of instances.
的实例。
But as an alternative, you can decrease the number of instances and then increase back again.但作为替代方案,您可以减少实例数,然后再次增加。 Or if you want more granular control, for any reason, then you can deploy the web app in IaaS Virtual Machine workloads and setup instances manually.
或者,如果您出于任何原因想要更精细的控制,那么您可以在 IaaS 虚拟机工作负载中部署 Web 应用程序并手动设置实例。
At the time of this posting, there is a Health Check (Preview) feature mentioned in the Azure Portal under the "Diagnose and solve problems -> Best Practices" blade for an App Service.在发布本文时,Azure 门户中的“诊断和解决问题 -> 最佳实践”边栏选项卡中提到了应用服务的运行状况检查(预览)功能。
Health Check feature automatically removes a faulty instance from rotation, thus improving availability.
健康检查功能会自动从轮换中删除故障实例,从而提高可用性。 This feature will ping the specified health check path on all instances of your webapp every 2 minutes.
此功能将每 2 分钟在您的 web 应用程序的所有实例上 ping 指定的运行状况检查路径。 If an instance does not respond within 10 minutes (5 pings), the instance is determined to be unhealthy and our service will stop routing requests to it.
如果实例在 10 分钟(5 次 ping)内未响应,则确定该实例运行状况不佳,我们的服务将停止向其路由请求。 It is highly recommended for production apps to utilize this feature and minimize any potential downtime caused due to a faulty instance.
强烈建议生产应用程序使用此功能,并最大限度地减少因故障实例导致的任何潜在停机时间。 Note : Health Check feature only works for applications that are hosted on more than one instance.
注意:健康检查功能仅适用于托管在多个实例上的应用程序。 For more information check the documentation below.
有关更多信息,请查看下面的文档。
你可以使用“高级应用程序重启”重启单个实例,你可以在 Azure 门户中应用服务的诊断工具下找到它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.