暂无图片
PostgreSQL9.6服务断电后无法启动
我来答
分享
Breeze
2023-01-10
PostgreSQL9.6服务断电后无法启动

断电后重启数据库日志:

2023-01-09 23:29:58.703 CST,,,1799,,63bc32f6.707,1,,2023-01-09 23:29:58 CST,,0,LOG,00000,"database system was shut down at 2023-01-09 15:47:41 CST",,,,,,,,"StartupXLOG, xlog.c:6079",""
2023-01-09 23:29:58.718 CST,,,1799,,63bc32f6.707,2,,2023-01-09 23:29:58 CST,,0,LOG,00000,"invalid primary checkpoint record",,,,,,,,"ReadCheckpointRecord, xlog.c:7929",""
2023-01-09 23:29:58.752 CST,,,1799,,63bc32f6.707,3,,2023-01-09 23:29:58 CST,,0,LOG,00000,"using previous checkpoint record at 6A/A5D15930",,,,,,,,"StartupXLOG, xlog.c:6369",""
2023-01-09 23:29:58.782 CST,,,1799,,63bc32f6.707,4,,2023-01-09 23:29:58 CST,,0,PANIC,XX000,"replication checkpoint has wrong magic 0 instead of 307747550",,,,,,,,"StartupReplicationOrigin, origin.c:702",""
2023-01-09 23:30:02.823 CST,,,1886,"192.168.52.196:57332",63bc32fa.75e,1,"",2023-01-09 23:30:02 CST,,0,LOG,00000,"connection received: host=192.168.52.196 port=57332",,,,,,,,"BackendInitialize, postmaster.c:4227",""
2023-01-09 23:30:02.823 CST,"dsecs","dsdb",1886,"192.168.52.196:57332",63bc32fa.75e,2,"",2023-01-09 23:30:02 CST,,0,FATAL,57P03,"the database system is starting up",,,,,,,,"ProcessStartupPacket, postmaster.c:2240",""
2023-01-09 23:30:03.207 CST,,,1887,"192.168.52.194:12222",63bc32fb.75f,1,"",2023-01-09 23:30:03 CST,,0,LOG,00000,"connection received: host=192.168.52.194 port=12222",,,,,,,,"BackendInitialize, postmaster.c:4227",""
2023-01-09 23:30:03.207 CST,"postgres","dsdb",1887,"192.168.52.194:12222",63bc32fb.75f,2,"",2023-01-09 23:30:03 CST,,0,FATAL,57P03,"the database system is starting up",,,,,,,,"ProcessStartupPacket, postmaster.c:2240",""
2023-01-09 23:30:04.580 CST,,,1794,,63bc32f6.702,2,,2023-01-09 23:29:58 CST,,0,LOG,00000,"startup process (PID 1799) was terminated by signal 6: Aborted",,,,,,,,"LogChildExit, postmaster.c:3592",""
2023-01-09 23:30:04.580 CST,,,1794,,63bc32f6.702,3,,2023-01-09 23:29:58 CST,,0,LOG,00000,"aborting startup due to startup process failure",,,,,,,,"reaper, postmaster.c:2841",""
2023-01-09 23:30:04.837 CST,,,1794,,63bc32f6.702,4,,2023-01-09 23:29:58 CST,,0,LOG,00000,"database system is shut down",,,,,,,,"UnlinkLockFiles, miscinit.c:763",""


执行pg_resetxlog -f $PGDATA 后重启日志:

2023-01-10 14:27:21.399 CST,,,45691,,63bd0549.b27b,1,,2023-01-10 14:27:21 CST,,0,LOG,00000,"ending log output to stderr",,"Future log output will go to log destination ""csvlog"".",,,,,,"PostmasterMain, postmaster.c:1276",""
2023-01-10 14:27:21.402 CST,,,45710,,63bd0549.b28e,1,,2023-01-10 14:27:21 CST,,0,LOG,00000,"database system was shut down at 2023-01-10 14:15:09 CST",,,,,,,,"StartupXLOG, xlog.c:6079",""
2023-01-10 14:27:21.402 CST,,,45710,,63bd0549.b28e,2,,2023-01-10 14:27:21 CST,,0,PANIC,XX000,"replication checkpoint has wrong magic 0 instead of 307747550",,,,,,,,"StartupReplicationOrigin, origin.c:702",""
2023-01-10 14:27:21.801 CST,,,45691,,63bd0549.b27b,2,,2023-01-10 14:27:21 CST,,0,LOG,00000,"startup process (PID 45710) was terminated by signal 6: Aborted",,,,,,,,"LogChildExit, postmaster.c:3592",""
2023-01-10 14:27:21.801 CST,,,45691,,63bd0549.b27b,3,,2023-01-10 14:27:21 CST,,0,LOG,00000,"aborting startup due to startup process failure",,,,,,,,"reaper, postmaster.c:2841",""
2023-01-10 14:27:21.825 CST,,,45691,,63bd0549.b27b,4,,2023-01-10 14:27:21 CST,,0,LOG,00000,"database system is shut down",,,,,,,,"UnlinkLockFiles, miscinit.c:763",""

看不出相关报错,服务启动失败       

我来答
添加附件
收藏
分享
问题补充
2条回答
默认
最新
农夫三拳

这个问题有点大了,怎么都报  .c 文件了错误了?

暂无图片 评论
暂无图片 有用 0
暂无图片
yBmZlQzJ
2023-01-10
大概率是停电造成文件损坏吧,还原是最快最好的方法,提桶跑路也行。
yBmZlQzJ

不用找原因了,有备份就还原,没备份就跑路~~

暂无图片 评论
暂无图片 有用 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏