重新启动Azure Worker角色"WaWorkerHost.exe";手动地 [英] Restarting Azure Worker role "WaWorkerHost.exe" manually

查看:136
本文介绍了重新启动Azure Worker角色"WaWorkerHost.exe";手动地的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,通过名为 WaWorkerHost.exe 的主机应用程序的帮助运行的Azure Worker角色,还有另一个名为 WaHostBootstrapper.exe 的应用程序,该应用程序将检查 WaWorkerHost.exe 正在运行,如果没有运行,它将运行 WaWorkerHost.exe .

  1. 此工人角色状态检查"多久进行一次?
  2. 我如何快速自己重新启动Worker角色?我可以重启正在运行的计算机辅助角色,然后等待几分钟,或者选择以下传统方法:

    Taskkill/im/f WaWorkerHost.exe

    并等待几分钟,以启动 WaHostBootstrapper.exe ,但这效率很低而且很慢.是否有(立即)重启工作者角色的方法?

  3. 我可以运行以下内容并期望与 WaHostBootstapper.exe 类似的结果吗?还是需要考虑其他因素?

    WaWorkerHost.exe {MyAzureWorkerRole.dll}

解决方案

  1. 引导程序每隔1秒检查一次WaWorkerHost状态.
    您可以通过查看跟踪间隔来在引导程序日志(c:\ resources \ WaHostBootstrapper.txt)中查看它:

从客户端WaWorkerHost.exe获取状态"


  1. 您可以使用

    或者,您可以通过编程方式重新启动实例:

    使用 Microsoft Azure计算管理库:

      X509Certificate2 cert = new X509Certificate2(");var凭证=新的CertificateCloudCredentials("your_subscription_id",cert);使用(var managementClient = new ComputeManagementClient(credentials)){OperationStatusResponse响应=等待managementClient.Deployments.RebootRoleInstanceByDeploymentSlotAsync("cloud_service_name",DeploymentSlot.Production,//或暂存"instance_name");} 


    1. 不建议这样做,原因有以下三个:

      1. 引导程序每秒检查一次,对于大多数情况来说应该足够了.
      2. 这可能会导致奇怪的问题.例如,您杀死该工作程序,引导程序标识该工作程序已关闭,您手动启动该工作程序,引导程序也尝试启动该工作程序而失败(会崩溃吗?将进入僵尸状态?).它可能导致不健康的引导程序,这意味着没有任何事情可以照顾到工作进程.
      3. 这当然取决于引导程序除了启动工作程序外还做什么.但是,即使当前除了启动角色之外,它什么也没做,您无法确定明天的Azure团队是否会决定向其添加更多职责/动作.

    As I understand Azure Worker roles run by the help of Host application called WaWorkerHost.exe and there is another application called WaHostBootstrapper.exe which checks if WaWorkerHost.exe is running and if not it will run the WaWorkerHost.exe.

    1. How often does this 'worker role status check' occurs?
    2. How can I quickly restart the Worker role myself? I can either reboot the machine worker role is running and wait for few minutes or chose the following traditional method:

      Taskkill /im /f WaWorkerHost.exe

      and wait for few minutes for the WaHostBootstrapper.exe to kick in but this very inefficient and slow. Is there any (instant)method of restarting the worker role?

    3. Can I run something like the following and expect similar results to the WaHostBootstapper.exe or there are other consideration?

      WaWorkerHost.exe {MyAzureWorkerRole.dll}

    解决方案

    1. The bootstrapper checks the WaWorkerHost status every 1 second.
      You can see it in the bootsrapper logs (c:\resources\WaHostBootstrapper.txt), by looking at interval of the trace:

    "Getting status from client WaWorkerHost.exe"


    1. You can use AzureTools which is a utility used by Azure support team.

    One of the its features is gracefully recycle the role instance:

    Alternatively, you can restart the instance programmatically:

    • Upload management certificate to your subscription.
    • Use the following code to programmatically restart the instance:

    Using Microsoft Azure Compute Management library:

    X509Certificate2 cert = new X509Certificate2("");
    var credentials = new CertificateCloudCredentials("your_subscription_id", cert);
    
    using (var managementClient = new ComputeManagementClient(credentials))
    {
        OperationStatusResponse response =
            await managementClient.Deployments.RebootRoleInstanceByDeploymentSlotAsync(
                "cloud_service_name",
                DeploymentSlot.Production, // or staging
                "instance_name");
    }
    


    1. This is not recommended, for three reasons:

      1. The bootsrapper checks every second, which should be enough for most cases.
      2. It could lead to weird issues. For example, you kill the worker, bootstrapper identifies that the worker is down, you manually start the worker, bootstrapper also tries to start the worker and fail (will crash? will enter zombie state?). It can lead to unhealthy bootstrapper, means that nothing takes care of the worker process.
      3. It depends, of course, on what's the bootstrapper does other than starting the worker. But even if it is currently does nothing other than starting the role, you cannot know for sure if tomorrow Azure team will decide to add it more responsibilities/actions.

    这篇关于重新启动Azure Worker角色"WaWorkerHost.exe";手动地的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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