我在运行couchdb服务时遇到问题。 当我开始的时候,它只能在closures之前停留一秒钟左右。 这是一个例子 – 首先是状态命令,显示它是不活动的。 开始声称它正在运行,下一个状态命令说它是活动的,发出一个新的状态,一秒钟后说它失败了。 这是怎么回事?
username@myPC:~$ /etc/init.d/couchdb status ? couchdb.service - System-wide CouchDB instance Loaded: loaded (/lib/systemd/system/couchdb.service; enabled; vendor preset: enabled) Active: failed (Result: start-limit) since to. 2016-01-28 22:56:32 CET; 9min ago Process: 2906 ExecStart=/usr/bin/couchdb (code=exited, status=1/FAILURE) Main PID: 2906 (code=exited, status=1/FAILURE) jan. 28 22:56:32 myPC systemd[1]: couchdb.service: Main process exited, code=exited, status=1/FAILURE jan. 28 22:56:32 myPC systemd[1]: couchdb.service: Unit entered failed state. jan. 28 22:56:32 myPC systemd[1]: couchdb.service: Failed with result 'exit-code'. jan. 28 22:56:32 myPC systemd[1]: couchdb.service: Service hold-off time over, scheduling restart. jan. 28 22:56:32 myPC systemd[1]: Stopped System-wide CouchDB instance. jan. 28 22:56:32 myPC systemd[1]: couchdb.service: Start request repeated too quickly. jan. 28 22:56:32 myPC systemd[1]: Failed to start System-wide CouchDB instance. jan. 28 22:56:32 myPC systemd[1]: couchdb.service: Unit entered failed state. jan. 28 22:56:32 myPC systemd[1]: couchdb.service: Failed with result 'start-limit'. username@myPC:~$ /etc/init.d/couchdb start [ ok ] Starting couchdb (via systemctl): couchdb.service. username@myPC:~$ /etc/init.d/couchdb status ? couchdb.service - System-wide CouchDB instance Loaded: loaded (/lib/systemd/system/couchdb.service; enabled; vendor preset: enabled) Active: active (running) since to. 2016-01-28 23:06:34 CET; 367ms ago Main PID: 3071 (beam) CGroup: /system.slice/couchdb.service +-3071 /usr/lib/erlang/erts-7.0/bin/beam -Bd -K true -A 4 -- -root /usr/lib/erlang -progname erl -- -home /var/... jan. 28 23:06:34 myPC systemd[1]: couchdb.service: Service hold-off time over, scheduling restart. jan. 28 23:06:34 myPC systemd[1]: Stopped System-wide CouchDB instance. jan. 28 23:06:34 myPC systemd[1]: Started System-wide CouchDB instance. jan. 28 23:06:34 myPC couchdb[3071]: {error_logger,{{2016,1,28},{23,6,34}},std_error,"File operation error: eacces....ver."} jan. 28 23:06:34 myPC couchdb[3071]: {error_logger,{{2016,1,28},{23,6,34}},std_error,"File operation error: eacces....ver."} jan. 28 23:06:34 myPC couchdb[3071]: =ERROR REPORT==== 29-Jan-2016::00:06:34 === jan. 28 23:06:34 myPC couchdb[3071]: File operation error: eacces. Target: /lost+found/ebin. Function: read_file_in...erver. jan. 28 23:06:34 myPC couchdb[3071]: =ERROR REPORT==== 29-Jan-2016::00:06:34 === jan. 28 23:06:34 myPC couchdb[3071]: File operation error: eacces. Target: /root/ebin. Function: read_file_info. Pr...erver. Hint: Some lines were ellipsized, use -l to show in full. username@myPC:~$ /etc/init.d/couchdb status ? couchdb.service - System-wide CouchDB instance Loaded: loaded (/lib/systemd/system/couchdb.service; enabled; vendor preset: enabled) Active: failed (Result: start-limit) since to. 2016-01-28 23:06:35 CET; 1s ago Process: 3097 ExecStart=/usr/bin/couchdb (code=exited, status=1/FAILURE) Main PID: 3097 (code=exited, status=1/FAILURE) jan. 28 23:06:35 myPC systemd[1]: couchdb.service: Main process exited, code=exited, status=1/FAILURE jan. 28 23:06:35 myPC systemd[1]: couchdb.service: Unit entered failed state. jan. 28 23:06:35 myPC systemd[1]: couchdb.service: Failed with result 'exit-code'. jan. 28 23:06:35 myPC systemd[1]: couchdb.service: Service hold-off time over, scheduling restart. jan. 28 23:06:35 myPC systemd[1]: Stopped System-wide CouchDB instance. jan. 28 23:06:35 myPC systemd[1]: couchdb.service: Start request repeated too quickly. jan. 28 23:06:35 myPC systemd[1]: Failed to start System-wide CouchDB instance. jan. 28 23:06:35 myPC systemd[1]: couchdb.service: Unit entered failed state. jan. 28 23:06:35 myPC systemd[1]: couchdb.service: Failed with result 'start-limit'.
我找不到任何日志文件/标准输出/标准错误。 这似乎是什么东西试图重新启动couchdb,但基于“couchdb.service:服务暂停时间结束,调度重新启动失败”。 但为什么?
问题在这些行中定义:
jan. 28 23:06:34 myPC couchdb[3071]: =ERROR REPORT==== 29-Jan-2016::00:06:34 === jan. 28 23:06:34 myPC couchdb[3071]: File operation error: eacces. Target: /lost+found/ebin. Function: read_file_in...erver. jan. 28 23:06:34 myPC couchdb[3071]: =ERROR REPORT==== 29-Jan-2016::00:06:34 === jan. 28 23:06:34 myPC couchdb[3071]: File operation error: eacces. Target: /root/ebin. Function: read_file_info. Pr...erver.
它试图find编译CouchDB束文件的ebin目录,但由于权限问题(eacces)而失败。 但是,原因是不在权限,但在path:为什么它在/根目录中寻找梁? 可能是因为它没有检查所有其他选项(并且该服务以root身份运行,什么是坏的)。
唯一可能的答案是您有$ ERL_LIBSpathconfiguration错误。 它需要设置梁命令行参数,如-env ERL_LIBS $ERL_LIBS:/usr/lib64/couchdb/erlang/lib – 注意,这里的path应根据您的安装进行设置。