我怎么做故意Azure角色会崩溃吗? [英] How do I intentionally make Azure role crash?

查看:167
本文介绍了我怎么做故意Azure角色会崩溃吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打一个Windows Azure应用程序尽可能容错性,我需要能够使角色崩溃故意测试整个应用程序从这种崩溃的恢复情况。

I want to make a Windows Azure application as fault-resistant as possible and I need to be able to make roles crash intentionally to test how the whole application recovers from such crashes.

我想我可以插入code右转进入,将获得一个随机数,并决定用一些比较低的概率崩溃的作用。真正的问题是

I guess I could insert code right into role that would obtain a random number and decide to crash with some rather low probability. The real problem is

if( isTimeToCrash() ) {
   //what exactly do I do here?
}

一旦我决定现在是时候如何崩溃的作用。

how to crash a role once I decide it is time.

我如何可靠地故意破坏一个Azure角色?

How do I reliably crash an Azure role intentionally?

推荐答案

您既可以RDP到机器或使用启动任务添加计划任务,将定期杀死'WaAppAgent过程。 PowerShell是pretty好这里找到并杀死进程。你需要一个管理员做到这一点。这将断绝与织物控制器通信的一段时间,直到它恢复并重新启动该过程。 IIRC,它也将杀死你的RoleEntryPoint code(下无论是WaWebHost或WaWorkerHost运行)。这将模拟pretty大失败。

You can either RDP into the machine or use a Startup task to add a scheduled task that will periodically kill the 'WaAppAgent' process. Powershell is pretty good here to find and kill the process. You need to be an admin to do it. This will sever the communication with the fabric controller for a period of time until it recovers and restarts the process. IIRC, it will also kill your RoleEntryPoint code (running under either WaWebHost or WaWorkerHost). That will simulate a pretty big failure.

如果你想获得真正看中的,运行监听到一个队列,当它看到一个消息队列将杀死需求的过程中后台启动任务。请注意,你不会把在这RoleEntryPoint code,这将需要一个启动任务运行的背景,或者您也将杀死崩溃你的角色的过程。

If you want to get really fancy, run a background startup task that listens to a queue and will kill the process on demand when it sees a queue message. Note, you would not put this code in RoleEntryPoint, it would need to be a startup task running as 'background' or you would also kill the process that is crashing your role.

这篇关于我怎么做故意Azure角色会崩溃吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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