1

我正在使用MongoDB 工作者角色项目在 Azure 上使用 MongoDB。我有两个独立的云服务,其中一个一切正常,但在另一个中,MongoDB 工作人员角色陷入了某种Busy (Waiting for role to start... Calling OnRoleStart状态。

我连接到其中一个 MongoDB 工作角色并访问 MongoDB 日志文件,发现以下错误:

[rsStart] replSet can't get local.system.replset config from self or any seed (EMPTYCONFIG)

有关于如何正常解决此问题的线程,但 Windows Azure 没有。我没有为 MongoDB 工作角色配置任何东西(除了 Azure 存储连接字符串),它在另一个服务中工作,所以我不知道为什么它不适用于这个服务。任何想法?

4

1 回答 1

0

Some time ago I was trying to host RavenDB in Azure as Worker Role and had lot's of issues with it as well.

Today, I believe it's better to run database the "suggested" way on target platform which is as Windows Service according to this "Install MongoDB on Windows" guide. This way you won't have to deal with Azure-specific issues. To achieve this you can:

  1. Use Azure CmdLets along with CsPack.exe to create the package for MondoDB.
  2. A solution similiar to RavenDB Master-Slave reads on Azure which I posted on GitHub.
  3. Sign up for Virtual Machine (beta) on Azure, kick off a machine and install MongoDB manually there.

But I guess the most important question when hosting DB is: where do you plan to store the actual DB?

  • Azure's CloudDrive, which is a VHD stored in Cloud Storage, has the worst IO performance possible. Not sufficient for normal DB usage I'd say.
  • Ephemeral storage, a Cloud Service local disk space, has perfect IO, but you lose all data once VM is deleted. This means you usually want to make continious or at least regular backups to Cloud Storage, maybe through CloudDrive.
  • Azure VM attached disk - has better IO than CloudDrive, but still not as good as Ephemeral storage.

As for the actual troubleshooting to your problem. I'd suggest wrapping OnRoleStart with try-catch, writting it to the log, enabling RDP to the box and then connecting and looking into the actual issue right in place. Another alternative is using IntelliTrace, but you need VS Ultimate for that. Also, don't forget that Azure requires usage of Local Resources if your app needs to make writes to the disk.

于 2013-04-07T09:05:11.113 回答