简体   繁体   English

CouchDB econnrefused

[英]CouchDB econnrefused

I am having trouble adding an external process to my CouchDB database. 我在将外部进程添加到CouchDB数据库时遇到问题。 Currently the database contains a few records, all of which have standalone attachments in the form of PNG or JPG. 当前,数据库包含一些记录,所有记录都具有PNG或JPG形式的独立附件。 I want to add the Couch_Image_Resizer (by KlausTrainer) to the database so that I can use the queries offered by the Image Resizer to dynamically resize the images on request. 我想将Couch_Image_Resizer(由KlausTrainer创建)添加到数据库中,以便可以使用Image Resizer提供的查询来根据请求动态调整图像的大小。 However currently it only returns an error when the URL command is used: 但是,当前仅在使用URL命令时返回错误:

http://virtualMachineAddress/_image/archive/test/the_starry_night_painting.jpg?resize=500x500

{"error":"error","reason":"{conn_failed,{error,econnrefused}}"}

I have followed the instructions to the letter, replacing any instance of localhost or 127.0.0.1 with the IP address of my virtual machine (which has been made elastic so should never change) where needed. 我已按照字母上的说明进行操作,在需要的地方用我的虚拟机的IP地址(已使其具有弹性,因此永远不要更改)替换localhost或127.0.0.1的任何实例。

I have also altered the local.ini file as was instructed so that it includes the following: 我还按照指示更改了local.ini文件,使其包含以下内容:

[httpd_global_handlers]
_image = {couch_httpd_proxy, handle_proxy_req, <<"http://127.0.0.1:5985">>}

Finally I have ensured that the program is running via the ./start.sh command. 最后,我已确保该程序通过./start.sh命令运行。 If this is run more than once it returns the following, I am usure as to if it is relevant: 如果多次执行此操作,它将返回以下内容,请确保它是否相关:

root@couchdb couchdb/couch_image_resizer# ./start.sh
Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) {application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})

Crash dump was written to: erl_crash.dump
Kernel pid terminated (application_controller) {application_start_failure,kernel,{shutdown,{kernel,start,[normal,[]]}}})`

Some info that might be helpful 一些信息可能会有所帮助

erl_crash.dump: pastebin erl_crash.dump: pastebin

Server is a virtual AWS machine running Debian 7.9 Wheezy. 服务器是运行Debian 7.9 Wheezy的虚拟AWS机器。 The database is hosted externally on this server. 数据库外部托管在此服务器上。

CouchDB version: 1.2.0 CouchDB版本:1.2.0

The database is not in Admin Party mode, accounts with permissions are in use. 该数据库不在“管理方”模式下,正在使用具有权限的帐户。

GitHub link: Couch_Image_Resizer GitHub链接: Couch_Image_Resizer

Erlang: erts-5.9.1 64-bit Erlang:erts-5.9.1 64位

ImageMagick: 6.8.9-9 ImageMagick:6.8.9-9

I am clearly missing something here, if you need anything else just ask. 如果您还需要其他任何内容,请问一下,我显然在这里丢失了一些东西。 If anyone can shed any light on what I am missing I would greatly appreciate it! 如果有人能对我所缺少的内容有所了解,我将不胜感激!

I have found a solution to this although there may be others. 尽管可能还有其他解决方法,但我已经找到了解决方案。

Stop the service, set its permissions to be owned exclusively by the couchdb user and then adding the start.sh file path to the [osdaemon] section of CouchDB's local.ini before restarting the database and also launching the application as a root user. 停止该服务,将其权限设置为沙发床用户专有,然后将start.sh文件路径添加到CouchDB的local.ini的[osdaemon]节中,然后重新启动数据库并以root用户身份启动该应用程序。 Doing this was able to kick-start the service and it now functions normally and as intended. 这样做能够启动该服务,并且它现在可以正常运行并按预期运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM