PANIC: could not locate a valid checkpoint record

 LOG:  listening on IPv6 address "::", port 5432
 LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
 LOG:  could not resolve "localhost": Name or service not known
 LOG:  disabling statistics collector for lack of working socket
 LOG:  database system was interrupted; last known up at 2022-07-29 17:43:18 CST
 LOG:  invalid primary checkpoint record
 PANIC:  could not locate a valid checkpoint record
 LOG:  startup process (PID 28908) was terminated by signal 6: Aborted
 LOG:  aborting startup due to startup process failure
 LOG:  database system is shut down
 LOG:  starting PostgreSQL 13.2 on x86_64-buildroot-linux-gnu, compiled by x86_64-tnas-linux-gnu-gcc.br_real (Buildroot 2017.11.2) 7.2.0, 64-bit
 LOG:  listening on IPv4 address "0.0.0.0", port 5432
 LOG:  listening on IPv6 address "::", port 5432
 LOG:  listening on Unix socket "/tmp/.s.PGSQL.5432"
 LOG:  could not resolve "localhost": Name or service not known
 LOG:  disabling statistics collector for lack of working socket
 LOG:  database system was interrupted; last known up at 2022-07-29 17:43:18 CST
 LOG:  invalid primary checkpoint record
 PANIC:  could not locate a valid checkpoint record
 LOG:  startup process (PID 29066) was terminated by signal 6: Aborted
 LOG:  aborting startup due to startup process failure
 LOG:  database system is shut down

postgresql 报错

想要解决这个问题通常需要执行如下命令

su - postgres -c 'pg_resetwal  /media/pgsql'

pg_resetwal  老版本可能不是这个命令

现在报错, 按照提示加上 -f 

The database server was not shut down cleanly.
Resetting the write-ahead log might cause data to be lost.
If you want to proceed anyway, use -f to force reset.

su - postgres -f -c 'pg_resetwal  /media/pgsql'


版权声明:本文为qq331565760原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。