CouchDB 不会作为服务安装在 Azure Windows VM 上

CouchDB will not install as a service on Azure Windows VM

我之前使用安装程序 setup-couchdb-1.6 在我的 Azure Windows VM(经典)上安装了 CouchDB,没有任何问题。1_R16B02.exe 从 http://couchdb.apache.org/[=16= 下载]

今天我卸载了现有的 CouchDB 安装和服务,打算从头开始重新安装。不幸的是,每当我 运行 安装程序现在都无法创建 windows 服务。更多信息:

erlsrv.exe add "Apache CouchDB" -workdir "%COUCH%\bin" -onfail restart_always -args "-sasl errlog_type error -s couch +A 4 +W w" -comment "Apache CouchDB 1.6.1"

这似乎创建了一个服务(您可以在 Windows 服务中看到)但是任何启动该服务的尝试都会导致错误:

Windows could not start the Apache CouchDB service on Local Computer.

Error 1067: The process terminated unexpectedly.

我可以看到我过去尝试添加的服务。任何删除它们的尝试都会导致错误消息:

erosrv: Unable to remove service (not enough privileges?)

Error: The handle is invalid

(我正在使用 erlsrv list 命令提供的句柄)

如何让 CouchDB 正确安装为服务?

TL;DR: 在没有空格的目录路径中重新安装,然后手动创建服务。

好吧,今天在我的谷歌搜索中的某个时候,我遇到了 this answer,这给了我线索,我应该安装在一个没有空格的路径中。所以我的解决方案是:

  • 通过 Windows 控制面板卸载 CouchDB 应用程序。
  • 运行 任何剩余的 CouchDB 安装中的 uninstall.exe 并删除这些目录。
  • 使用 SC 命令删除现有服务。
  • 使用安装程序重新安装到 C:\CouchDB(注意:没有空格!)。 Select 作为服务安装的选项(尽管这不太有效)。
  • 运行手动创建服务的命令。请注意,我没有使用 %COUCH% 变量,因为此时它似乎不存在于我的系统中:

erlsrv.exe add "CouchDB" -workdir "C:\CouchDB\bin" -onfail restart_always -args "-sasl errlog_type error -s couch +A 4 +W w" -comment "CouchDB 1.6.1"

此命令最终设法为正确启动的 CouchDB 正确创建 windows 服务。浏览 http://localhost:5984/_utils/ 现在将我带到蒲团 UI。放松一下!