zhaiduo.com

Loving Coding & Visual Design

PostgreSQL 11 报错:PANIC: could not locate a valid checkpoint record

Docker up 的时候,显示 PostgreSQL 启动失败:

db_1     | 2019-10-07 05:51:27.608 UTC [22] LOG:  database system was interrupted; last known up at 2019-10-06 10:17:33 UTC
db_1     | 2019-10-07 05:52:03.416 UTC [22] LOG:  invalid record length at 0/1832AA8: wanted 24, got 0
db_1     | 2019-10-07 05:52:03.416 UTC [22] LOG:  invalid primary checkpoint record
db_1     | 2019-10-07 05:52:03.416 UTC [22] PANIC:  could not locate a valid checkpoint record


解决办法:
1. 登录 postgres : docker run -ti postgres /bin/bash
2. 切换到 postgres 用户
3. 执行修复命令:/usr/lib/postgresql/11/bin/pg_resetwal -f /var/lib/postgresql/data
4. 如果看到“Write-ahead log reset”,表示修复成功。

最 近 文 章

622.对 SSR 服务端渲染的看法Sun Oct 06 2019 18:15:35 GMT+0800 (CST)
620.React Hooks 使用心得Mon Sep 23 2019 01:08:22 GMT+0800 (CST)
619.Openwrt踩坑记Tue Sep 17 2019 11:18:49 GMT+0800 (CST)
618.找房计划第二趴Fri Sep 13 2019 13:00:51 GMT+0800 (CST)
617.找房计划第一趴Tue Sep 10 2019 01:35:46 GMT+0800 (CST)
616.buildToolsVersion升级28.0.3的过程Tue Sep 10 2019 01:07:59 GMT+0800 (CST)
615.2019重构博客框架Thu Sep 05 2019 02:03:31 GMT+0800 (CST)
614.最适合开发的MAC电脑2019-01-10T18:59:38.640Z

Copyright © 2019@窄多之Blog SSR版本 v1.1.2

网站备案号:粤ICP备05005240号-1