3

我使用官方 Docker 映像运行 CouchDB v2.3。我已经使用 Fauxton 将数据库配置为单节点。

/data 目录挂载到本地目录。当我重新启动容器时,数据库仍然存在。所以卷绑定按预期工作。

现在,每次我重新启动容器并导航到“设置”选项卡时,看起来 CouchDB 不记得我已将其配置为单节点。

重新启动图像后,我一直看到以下屏幕 在此处输入图像描述

再次配置后,我会看到以下屏幕

在此处输入图像描述

直到我重新启动容器。然后我必须再次进入第一个屏幕。

这里发生了什么?

4

1 回答 1

1

I was using the wrong CouchDB configuration file path to apply my own configuration.

Non-working example (Dockerfile)

FROM couchdb:2.3
COPY local.ini /opt/couchdb/etc/local.d/docker.ini

Working example (Dockerfile)

FROM couchdb:2.3.0
COPY local.ini /opt/couchdb/etc/local.ini

local.ini

To make sure the cluster should not be re-configured when the Docker container is being re-started, I've also put the configuration inside the local.ini file.

; CouchDB Configuration Settings

; Custom settings should be made in this file. They will override settings
; in default.ini, but unlike changes made to default.ini, this file won't be
; overwritten on server upgrade.

[chttpd]
port = 5984
bind_address = 0.0.0.0

; To create an admin account uncomment the '[admins]' section below and add a
; line in the format 'username = password'. When you next start CouchDB, it
; will change the password to a hash (so that your passwords don't linger
; around in plain-text files). You can add more admin accounts with more
; 'username = password' lines. Don't forget to restart CouchDB after
; changing this.
[admins]
admin = ******

[cluster]
n = 1

I'm not yet sure why my initial configuration copied to /opt/couchdb/etc/local.d/docker.ini wasn't working before.

于 2019-03-18T15:45:55.900 回答