运行或重新启动PostgreSQL映像后,Docker容器立即退出

编程入门 行业动态 更新时间:2024-10-28 02:35:22
本文介绍了运行或重新启动PostgreSQL映像后,Docker容器立即退出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是docker的初学者,由于容器重启问题,我被卡在了位。 当我尝试重新启动现有的退出容器或创建新容器(删除旧容器后)运行时,会发生问题:

I am begginer with docker, and I stuck in place due to container restarting problem. The problem occures when I try to restart an existing exited container, or create new container (after deleting old one) running:

docker run -d --name mempostgres \ -v "/home/lukasz/lc_pg_data:/var/lib/pgsql/data:Z" \ -e POSTGRES_USER=postgres \ -e POSTGRES_PASSWORD=password \ -e POSTGRES_DB=dbName \ -p 5432:5432 \ fedora/postgresql

我的容器总是立即退出,状态为 Exited(1)

My container always exits immediately with status "Exited(1)"

我的容器日志有:

Inside the logs of my container i have:

但是我没有正在运行的PostgreSQL服务器

However I don't have any PostgreSQL server running at this moment.

推荐答案

您需要终止该 postmaster 进程。

cat ... / postmaster.pid

此文件的第一个数字是 postmaster 进程的PID。

The first number of this file is the PID of postmaster process.

然后,使用以下命令终止该进程:

Then, kill that process using:

杀死PID

最后,运行一个容器,您的问题应该得到解决。

Finally, run a container, your problem should be fixed.

更多推荐

运行或重新启动PostgreSQL映像后,Docker容器立即退出

本文发布于:2023-10-23 01:33:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1519345.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:映像   重新启动   容器   PostgreSQL   Docker

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!