Postgresql is stuck in recovery mode

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 sasprdos.lmggi.com systemd[1]: Starting PostgreSQL
> database server... Feb 19 08:39:21 sasprdos.lmggi.com pg_ctl[35865]:
> pg_ctl: cannot be run as root Feb 19 08:39:21 sasprdos.lmggi.com
> pg_ctl[35865]: Please log in (using, e.g., "su") as the (unprivileged)
> user that will Feb 19 08:39:21 sasprdos.lmggi.com pg_ctl[35865]: own
> the server process. Feb 19 08:39:21 sasprdos.lmggi.com systemd[1]:
> postgresql.service: control process exited, code=exited status=1 Feb
> 19 08:39:21 sasprdos.lmggi.com systemd[1]: Failed to start PostgreSQL
> database server. Feb 19 08:39:21 sasprdos.lmggi.com systemd[1]: Unit
> postgresql.service entered failed state. Feb 19 08:39:21
> sasprdos.lmggi.com systemd[1]: postgresql.service failed

.



Read more here: https://stackoverflow.com/questions/66271257/postgresql-is-stuck-in-recovery-mode

Content Attribution

This content was originally published by user2960496 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: