致命:锁定文件"postmaster.pid"中的伪造数据修复磁盘并更改数据文件夹位置后postgres docker [英] FATAL: bogus data in lock file "postmaster.pid" after repairing disk and changing the data folder location postgres docker

查看:70
本文介绍了致命:锁定文件"postmaster.pid"中的伪造数据修复磁盘并更改数据文件夹位置后postgres docker的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的硬盘驱动器出现问题,其中包含我们修复的postgres数据库的数据文件夹,现在,当我们尝试启动db容器时,将数据文件夹移动到新的硬盘驱动器中,我们得到以下错误.

We had a problem with our hard drive which contains the data folder for postgres database we repaired that hard and move the data folder to new hard drive now when we try to start our db container we get following error.

db_1                | 
db_1                | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1                | 
db_1                | FATAL:  bogus data in lock file "postmaster.pid": ""

我尝试删除postmaster.pid文件,但随后出现以下错误,

I tried to remove the postmaster.pid file but then I get the following error,

db_1                | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_1                | 
db_1                | LOG:  database system was interrupted; last known up at 2020-04-07 18:03:04 UTC
db_1                | LOG:  invalid primary checkpoint record
db_1                | LOG:  invalid secondary checkpoint record
db_1                | PANIC:  could not locate a valid checkpoint record
db_1                | LOG:  startup process (PID 28) was terminated by signal 6: Aborted
db_1                | LOG:  aborting startup due to startup process failure
app_db_1 exited with code 1

我们真的需要数据,我们没有任何备份.我们的 docker-compose.yml 包含以下db容器的内容,

we really need the data and we do not have any backup what we should do my docker-compose.yml contains the following contents for db container,

db:
  image: postgres:9.4
  volumes:
    - /mnt/hdd4/postgresql/data:/var/lib/postgresql/data
    - ./tmp:/tmp/docker
  ports:
    - "5432"

请让我知道是否需要其他信息.

Please let me know if extra information is required.

推荐答案

似乎数据库的重要部分被磁盘问题破坏了.如果您有备份,那就该还原它了.如果不是,那么您最好聘请一位PostgreSQL顾问,他擅长从这样的损坏数据库中挽救数据.

It seems like important parts of your database got destroyed by the disk problem. If you had a backup, that would be the time to restore it. If not, you had best hire a PostgreSQL consultant who is skilled with salvaging data from a corrupted database like this.

这篇关于致命:锁定文件"postmaster.pid"中的伪造数据修复磁盘并更改数据文件夹位置后postgres docker的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆