Pergunta

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.

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top