Postgresql stuck in recovery mode

2.1k Views Asked by At

We have recently configured Hortonworks cluster in our Platform. For ambari server, we have used Postgres as a DB. I accidentally deleted one of the postgres PIDs which resulted in some kind of DB corruption. Post that I'm unable to the postgress server.

Could anyone help, please? I'm stuck on this for almost a week now.

Error messages:

root@horton pg_log]# systemctl status
postgresql.service ? postgresql.service - PostgreSQL database server  
Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled;
vendor preset: disabled)    Active: failed (Result: exit-code) since
Fri 2021-02-19 08:39:21 IST; 4s ago   Process: 35865
ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t
300 (code=exited, status=1/FAILURE)   Process: 35859
ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited,
status=0/SUCCESS)  Main PID: 82606 (code=killed, signal=KILL)
 
Feb 19 08:39:21 horton systemd[1]: Starting PostgreSQL
database server... Feb 19 08:39:21 horton pg_ctl[35865]:
pg_ctl: cannot be run as root Feb 19 08:39:21 horton
pg_ctl[35865]: Please log in (using, e.g., "su") as the (unprivileged)
user that will Feb 19 08:39:21 horton pg_ctl[35865]: own
the server process. Feb 19 08:39:21 horton systemd[1]:
postgresql.service: control process exited, code=exited status=1 Feb
19 08:39:21 horton systemd[1]: Failed to start PostgreSQL
database server. Feb 19 08:39:21 horton systemd[1]: Unit
postgresql.service entered failed state. Feb 19 08:39:21
horton systemd[1]: postgresql.service failed

This is what I can see in the pg_log:

LOG: record with zero length at 2E/A77FE338 LOG: redo done at 2E/A77FE280
LOG: last completed transaction was at log time 2021-02-15 13:34:43.246282+05:30
0

There are 0 best solutions below