容器重新启动时,将再次出现“安装Apache CouchDB”屏幕 [英] Setup Apache CouchDB screen re-appears on container restart
问题描述
我有使用官方Docker映像运行的CouchDB v2.3。我已经使用Fauxton将数据库配置为单节点。
I have CouchDB v2.3 running using the official Docker image. I've configured the database as a Single Node using Fauxton.
/ data目录已安装到本地目录。重新启动容器时,数据库仍然存在。因此,卷绑定可以按预期工作。
The /data directory is mount to a local directory. When I'm restarting the container, the databases are still there. So the volume binding works as expected.
现在,每次我重新启动容器并导航到设置选项卡时,看起来CouchDB都不记得我了已将其配置为单个节点。
Now, everytime I'm restarting the container and I navigate to the 'Setup' tab, it looks like CouchDB did not remember I've configured it as a Single Node.
重新启动映像后,我仍然看到以下屏幕:
再次配置后,会看到以下屏幕
直到我重新启动容器。然后我必须再次进入第一个屏幕。
Until I reboot the container. Then I have to the first screen again.
这是怎么回事?
推荐答案
我使用了错误的 CouchDB配置文件路径来应用我自己的配置。
I was using the wrong CouchDB configuration file path to apply my own configuration.
非工作示例(Dockerfile)
FROM couchdb:2.3
COPY local.ini /opt/couchdb/etc/local.d/docker.ini
工作示例(Dockerfile)
FROM couchdb:2.3.0
COPY local.ini /opt/couchdb/etc/local.ini
local.ini
为了确保在重新启动Docker容器时不应重新配置群集,我还将配置放入 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
我不确定为什么我的初始配置复制到 /opt/couchdb/etc/local.d/docker.ini
以前没有工作。
I'm not yet sure why my initial configuration copied to /opt/couchdb/etc/local.d/docker.ini
wasn't working before.
这篇关于容器重新启动时,将再次出现“安装Apache CouchDB”屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!