postgres 退出,运行或重新启动PostgreSQL映像后,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

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

Inside the logs of my container i have:

647c6e2624e93605d74b31f4271d7ad1.png

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

解决方案

You need to kill that postmaster process.

cat .../postmaster.pid

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

Then, kill that process using:

kill PID

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值