我开始通过阅读用户指南并遵循官方CouchDB镜像上运行的Docker容器(使用标签latest
,CouchDB 2.3.1(来学习CouchDB。我正在使用一个容器,在本地运行。通过"Fauxton 设置"页面使用默认选项配置为单个节点(例如bind address
设置为0.0.0.0
(。
当我运行 Fauxton 的验证安装工具时,前 5 项检查通过,但复制检查失败并显示消息:
Error: could not resolve http://any:5984/verifytestdb/
同样,当我尝试将示例数据库复制到同一节点上的另一个数据库时,它失败了:
$ curl http://localhost:5984/_all_dbs
["_global_changes","_replicator","_users","albums","albums-replica"]
$ curl http://localhost:5984/_replicate
-d '{"source": "albums", "target": "albums-replica"}'
-H "Content-Type: application/json"
{"error":"nxdomain","reason":"could not resolve http://any:5984/albums/"}
我注意到在这两种情况下,错误都说any
而不是0.0.0.0
,但我不知道这是否重要。
我还尝试通过docker run --name loveseat -p 5984:5984 -d couchdb:latest
运行新容器,完成Fauxton设置,并立即单击Fauxton中的验证安装,我观察到相同的错误。
任何想法出了什么问题/我错过了什么?
更新
我已经在以下 Docker 映像标签上尝试了相同的过程:
latest
2.3.1
2.3
2.3.0
2
结果都是一样的。
如果您在Config
中使用 Fauxton>Main config
请将httpd
bind_address
从any
切换到0.0.0.0
我认为这是这个问题的重复
我使用的部分local.ini
文件如下。
[chttpd]
bind_address = 0.0.0.0
port = 5984
; When this option is set to true, no requests are allowed from anonymous users. Everyone must be authenticated.
require_valid_user = false
[cluster]
n = 1
[httpd]
enable_cors = true
bind_address = 0.0.0.0