Azure中Ubuntu VM上的CouchDB未启动

Azure中Ubuntu VM上的CouchDB未启动,ubuntu,couchdb,Ubuntu,Couchdb,我正在为一个新项目评估CouchDB,在这个项目中,它将是一个完美的选择,而不是我通常使用的DB(Mongo)。然而,安装似乎有问题。 我已使用安装了所有依赖项 sudo apt-get install build-essential sudo apt-get install erlang-base-hipe sudo apt-get install erlang-dev sudo apt-get install erlang-manpages sudo apt-get install erla

我正在为一个新项目评估CouchDB,在这个项目中,它将是一个完美的选择,而不是我通常使用的DB(Mongo)。然而,安装似乎有问题。 我已使用安装了所有依赖项

sudo apt-get install build-essential
sudo apt-get install erlang-base-hipe
sudo apt-get install erlang-dev
sudo apt-get install erlang-manpages
sudo apt-get install erlang-eunit
sudo apt-get install erlang-nox
sudo apt-get install libicu-dev
sudo apt-get install libmozjs-dev
sudo apt-get install libcurl4-openssl-dev
并进行了一次重复安装。然而,即使启动服务,它似乎也会启动,但当使用couchdb进入db时,我会收到一条错误消息

Apache CouchDB 1.5.0 (LogLevel=info) is starting.
Failure to start Mochiweb: eaddrinuse
[error] [<0.107.0>] {error_report,<0.31.0>,
                     {<0.107.0>,crash_report,
                      [[{initial_call,
                         {mochiweb_socket_server,init,['Argument__1']}},
                        {pid,<0.107.0>},
                        {registered_name,[]},
                        {error_info,
                         {exit,eaddrinuse,
                          [{gen_server,init_it,6,
                            [{file,"gen_server.erl"},{line,320}]},
                           {proc_lib,init_p_do_apply,3,
                            [{file,"proc_lib.erl"},{line,239}]}]}},
                        {ancestors,
                         [couch_secondary_services,couch_server_sup,<0.32.0>]},
                        {messages,[]},
                        {links,[<0.94.0>]},
                        {dictionary,[]},
                        {trap_exit,true},
                        {status,running},
                        {heap_size,987},
                        {stack_size,27},
                        {reductions,597}],
                       []]}}
{"init terminating in do_boot",{{badmatch,{error,{bad_return,{{couch_app,start,[normal,["/etc/couchdb/default.ini","/etc/couchdb/local.ini"]]},{'EXIT',{{badmatch,{error,{shutdown,{failed_to_start_child,couch_secondary_services,{shutdown,{failed_to_start_child,httpd,eaddrinuse}}}}}},[{couch_server_sup,start_server,1,[{file,"couch_server_sup.erl"},{line,98}]},{application_master,start_it_old,4,[{file,"application_master.erl"},{line,269}]}]}}}}}},[{couch,start,0,[{file,"couch.erl"},{line,18}]},{init,start_it,1,[]},{init,start_em,1,[]}]}}

Crash dump was written to: erl_crash.dump
init terminating in do_boot ()
apachecouchdb1.5.0(LogLevel=info)正在启动。 无法启动Mochiweb:eaddrinuse [错误][{错误报告,, {,撞车报告, [{初始呼叫, {mochiweb\u socket\u server,init,['Argument\u 1']}, {pid,}, {注册名称,[]}, {错误信息, {退出,使用, [{gen_server,init_it,6, [{file,“gen_server.erl”},{line,320}]}, {proc_lib,init_p_do_apply,3, [{file,“proc_lib.erl”},{line,239}]}, {祖先, [coach_secondary_services,coach_server_sup,]}, {消息,[]}, {links,[]}, {字典,[]}, {trap_exit,true}, {状态,正在运行}, {heap_size,987}, {堆栈大小,27}, {减少,597}], []]}} {“init终止于do_boot”、{badmatch、{error、{bad_return、{coach_app、start、[normal、[/etc/couchdb/default.ini”、“/etc/couchdb/local.ini”]}、{EXIT'、{badmatch、{error、{shutdown、{failed_启动子项、coach_辅助服务、{shutdown、{启动子项失败、{httpd、eaddrinuse}、{coach服务器、coach服务器、{superlu 1}、{coach服务器、{,{line,98}]},{application_master,start_it_old,4,[{file,“application_master.erl”},{line,269}]}}}},[{coach,start,0,[{file,coach.erl},{line,18}},{init init start_it,1,[]},{init init,start_em,1,[]}} 崩溃转储已写入:erl_Crash.dump 初始化终止于do_引导()
感谢您的建议,请记住我是couchdb的第一次用户。

我的问题似乎是我没有在azure VM上打开端口。我将发布此消息,以防任何人遇到同样的问题。

基本存储库中的couchdb版本很旧:1.5.0。您肯定要使用1.6.1。我正在运行Azure中Ubuntu14.04.4 LTS节点上的CouchDB 1.6.1,我没有看到您描述的问题

以下是升级到1.6.1(首先备份数据库)的命令:


根据提供的错误消息,CouchDB已经在您的虚拟机上启动并运行,或者某些服务正在您的虚拟机的端口5984(CouchDB默认端口)上运行

**{shutdown,{failed_to_start_child,httpd,eaddrinuse}}}}}}**
这就是couchdb无法启动的原因,因为couchdb配置的端口被VM上的服务占用(可能是couchdb服务或在同一端口上运行的其他服务)

使用以下命令终止couchDB默认端口上运行的服务:

/bin/ps aux | grep couchdb | grep -v grep | awk '{print $2}' | xargs kill -9
再次启动CouchDB:

service couchdb start

但是,如果我使用curl localhost:5984,我会得到正确的答案{“couchdb”:“欢迎”,“uuid”:“d884f3353f499a338dcaa20cb82b”,“version”:“1.5.0”,“vendor”:{“name”:“Ubuntu”,“version”:“14.04”}
service couchdb start