CouchDB在不使用Fauxton的情况下更改bind_address

问题描述

我想更新CouchDB v3.1.0实例的绑定地址(注意:安装在Windows 10上)。

我想使用Web UI(Fauxton)这样做。

这是我在做什么:

  1. 在文本编辑器中打开C:\CouchDB\etc\local.ini
  2. [chhtpd]部分中,我设置bind_address = 0.0.0.0
[chttpd]
;port = 5984
bind_address = 0.0.0.0
; Options for the MochiWeb HTTP server.
;server_options = [{backlog,128},{acceptor_pool_size,16}]
; For more socket options,consult Erlang's module 'inet' man page.
;socket_options = [{sndbuf,262144},{nodelay,true}]
  1. 保存更改
  2. 通过Apache CouchDB重新启动services.msc服务
  3. 我发现bind_address的更改尚未生效

[chttpd]的{​​{1}}部分似乎覆盖了我的价值。

C:\CouchDB\etc\local.d\10-admins.ini

我在做什么错?我需要更改[chttpd] bind_address = 127.0.0.1 port = 5984 文件中的bind_address吗?

解决方法

您是正确的,您需要更改etc\local.d\10-admins.ini文件中的绑定地址。
根据{{​​3}},文件etc/local.d/*.ini优先:

默认情况下,CouchDB从以下内容读取配置文件 位置,顺序如下:

etc/default.ini
etc/default.d/*.ini
etc/local.ini
etc/local.d/*.ini

所有路径都相对于CouchDB安装指定 目录:在类似UNIX的系统上,建议使用/ opt / couchdb C:\ CouchDB 在Windows系统上推荐使用,并且两个目录结合在一起 在macOS上:Applications / Apache CouchDB.app/Contents/Resources/couchdbx-core/etc用于default.ini 和default.d目录,以及/ Users / youruser / Library / Application support / CouchDB2 / etc / couchdb用于local.ini和local.d 目录。

后续文档中的设置将覆盖之前的设置 条目。例如,在中设置chttpd / bind_address参数 local.ini将覆盖default.ini中的任何设置。

,

您应该能够在不使用Web UI(Fauxton)的情况下更改X = [[input(f"Enter m{i}{j}: ") for j in range(3)] for i in range(3)]

获取节点成员身份信息以查看节点的名称。

bind_address

使用以下cURL请求更改chttpd / bind_address配置中的curl -X GET "http://localhost:5984/_membership" --user <username>

bind_address