2 个辅助角色、1 个 VHD、自动故障转移

发布于 2024-10-15 04:45:46 字数 413 浏览 2 评论 0原文

我有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆梦 2024-10-22 04:45:46

如果不调用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文