2 个辅助角色、1 个 VHD、自动故障转移
我有 2 个 Windows Azure 辅助角色和 1 个云驱动器 VHD(用于 Lucene.NET 文档)。目前,第一个辅助角色获取 VHD,第二个辅助角色不断尝试挂载 VHD(如果另一个辅助角色拥有 VHD,则会失败),并且只有成功后,才会进入辅助角色的运行部分。 ..
不过,我已经看到了几个问题:我在 OnStop 方法中手动卸载驱动器,这会解锁驱动器以供以后使用...但如果 OnStop 方法没有被调用,我的驱动器现在是两个系统都无法安装...其次,我的第二个实例不断被列为“未准备好”,一段时间后天蓝色认为这很奇怪..最后,即使该实例“未准备好”,它仍然出现在实例列表...
有没有人以前做过类似的事情,并且对我应该做什么来解决这个问题有任何提示?我想要一个故障转移搜索服务器,因为我的前端依赖于它,并且等待 Azure 启动新实例(5-15 分钟)是行不通的。
I have 2 Windows Azure Worker Roles, and 1 Cloud Drive VHD (for Lucene.NET documents). At the moment, the first worker role gets the VHD, and the second one constantly tries to mount the VHD (which fails if the other one has it) and only if it succeeds, does it go into the run section of the worker role...
There are a couple of problems i can see with this already though: i manually unmount the drive in the OnStop method, which unlocks the drive for later use... but if the OnStop method does not get called, my drive is now unmountable by both systems... Secondly, my second instance is constantly listed as "not ready" and azure after a while thinks this is odd.. And finally, even though the instance is "not ready", it is still showing up in the instance list...
Has anyone done anything like this before and have any tips on what i should do to get around this problem? I would like to have a fail over search server, since my front end depends on it, and waiting on Azure to kick up a new instance (5-15 min) will not stand.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果不调用 OnStop,则页面 Blob(支持 Windows Azure 驱动器的 VHD)上的租约将不再续订,这意味着它将在 60 秒后过期。
如果您的实例被列为“忙碌”,则您的代码可能尚未从 OnStart 返回。确保尝试安装驱动器的任何循环都在 Run() 中,而不是 OnStart() 中。
是的,如果您枚举实例,则应该显示该实例。如果您试图跟踪哪个实例安装了驱动器,我建议让该角色实例将其 ID 写入某处的 blob 或表中。当发生故障转移时,新实例将覆盖该 ID。
If OnStop isn't called, the lease on the page blob (the VHD backing the Windows Azure Drive) won't be renewed anymore, which means it will expire after 60 seconds.
If your instance is listed as "Busy," your code probably hasn't returned from OnStart. Make sure whatever loop you have trying to mount the Drive is in Run(), not OnStart().
Yes, the instance should show up if you enumerate instances. If you're trying to keep track of which instance has the Drive mounted, I would suggest having that role instance write its ID to a blob or table somewhere. When the failover happens, the new instance will overwrite that ID.