我想更新我的 CouchDB v3.1.0 实例的绑定(bind)地址(注意:安装在 Windows 10 上)。
我想在不使用 Web UI (Fauxton) 的情况下实现此目的。
这就是我正在做的事情:
- 在文本编辑器中打开
C:\CouchDB\etc\local.ini
- 在
[chHTpd]
部分中,我设置bind_address = 0.0.0.0
- 基于 this answer
[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}]
- 保存更改
- 通过
services.msc
重新启动Apache CouchDB
服务 - 我发现
bind_address
的更改尚未生效
看来 C:\CouchDB\etc\local.d\10-admins.ini
的 [chttpd]
部分覆盖了我的值。
[chttpd]
bind_address = 127.0.0.1
port = 5984
我做错了什么?我需要更改 10-admins.ini
文件中的 bind_address
吗?
最佳答案
您应该能够在不使用 Web UI (Fauxton) 的情况下更改 bind_address
。
获取节点成员信息以查看节点名称。
curl -X GET "http://localhost:5984/_membership" --user <username>
使用以下 cURL 请求更改 chttpd/bind_address 配置中的 bind_address
:
curl -X PUT -H 'Content-Type: application/json' http://localhost:5984/_node/<name@host>/_config/chttpd/bind_address -d '"0.0.0.0"' --user <username>
关于CouchDB 更改bind_address 而不使用Fauxton,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63849776/