Mar*_*rez 9 postgresql gitlab docker gitlab-ci-runner
使用我们自己的 Gitlab 实例,当我们background worker "logical replication launcher" exited with exit code 1尝试在我们的跑步者中使用 postgres 服务时,我们会收到错误消息。在互联网上没有找到任何有用的东西。知道发生了什么吗?
版本:
相关部分gitlab-ci.yml:
image: golang:1.12
services:
- postgres
variables:
POSTGRES_USER: postgres
POSTGRES_DB: xproject_test
POSTGRES_PASSWORD: postgres
Run Code Online (Sandbox Code Playgroud)
失败日志:
image: golang:1.12
services:
- postgres
variables:
POSTGRES_USER: postgres
POSTGRES_DB: xproject_test
POSTGRES_PASSWORD: postgres
Run Code Online (Sandbox Code Playgroud)
首先,您的数据库容器已准备好接受连接,正如您从日志中看到的
2019-11-20T10:16:25.248887712Z 2019-11-20 10:16:25.248 UTC [1] LOG: database system is ready to accept connections
Run Code Online (Sandbox Code Playgroud)
这是官方 Postgres 映像的预期行为 如果您查看Postgres的入口点,它会执行两项任务。
*.sql文件,运行任何可执行*.sh脚本,并提供*.sh在该目录中找到的任何非可执行脚本,以便在从此目录启动服务之前进行进一步的初始化/docker-entrypoint-initdb.d你知道我为什么收到关机请求吗?
# stop postgresql server after done setting up user and running scripts
docker_temp_server_stop() {
PGUSER="${PGUSER:-postgres}" \
pg_ctl -D "$PGDATA" -m fast -w stop
}
Run Code Online (Sandbox Code Playgroud)
然后完成后
.
.
echo 'PostgreSQL init process complete; ready for start up.'
.
.
exec "$@"
Run Code Online (Sandbox Code Playgroud)
最后重新启动安装了 gitlab 的机器,问题就解决了。不知道为什么服务会超时并打印误导性日志。
使用 docker 进行更好的健康检查的相关问题:https://gitlab.com/gitlab-org/gitlab-runner/issues/3984
使用 docker dind 生成 TLS 证书似乎可以解决该问题。您需要特权跑步者和 dind 服务.gitlab-ci.yml:
services:
- docker:dind
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13149 次 |
| 最近记录: |