PostgreSQL service start failed on CentOS 7

cancel
Showing results for 
Search instead for 
Did you mean: 
Boothe6952
Member II

PostgreSQL service start failed on CentOS 7

Installed PostgreSQL using:
sudo yum install postgresql-server postgresql-contrib

PostgreSQL version: 9.2.18

When start service:

sudo service postgresql start

Got error:

Redirecting to /bin/systemctl start  postgresql.service
Job for postgresql.service failed because the control process exited with error code. See "systemctl status postgresql.service" and "journalctl -xe" for details.

The journalctl -xe detail:

-- Unit postgresql.service has failed.
--
-- The result is failed.
 719 04:17:04 node2 systemd[1]: Unit postgresql.service entered failed state.
 719 04:17:04 node2 systemd[1]: postgresql.service failed.
 719 04:17:04 node2 polkitd[19772]: Unregistered Authentication Agent for unix-process:27133:53830492 (system bus name :1.405, object path /org/freedesktop/PolicyKit1/AuthenticationA
 719 04:19:33 node2 polkitd[19772]: Registered Authentication Agent for unix-process:27165:53845472 (system bus name :1.406 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object pat
 719 04:19:33 node2 systemd[1]: Starting PostgreSQL database server...
-- Subject: Unit postgresql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has begun starting up.
 719 04:19:34 node2 pg_ctl[27187]: pg_ctl: could not start server
 719 04:19:34 node2 pg_ctl[27187]: Examine the log output.
 719 04:19:34 node2 systemd[1]: postgresql.service: control process exited, code=exited status=1
 719 04:19:34 node2 systemd[1]: Failed to start PostgreSQL database server.
-- Subject: Unit postgresql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has failed.
--
-- The result is failed.
 719 04:19:34 node2 systemd[1]: Unit postgresql.service entered failed state.
 719 04:19:34 node2 systemd[1]: postgresql.service failed.
 719 04:19:34 node2 polkitd[19772]: Unregistered Authentication Agent for unix-process:27165:53845472 (system bus name :1.406, object path /org/freedesktop/PolicyKit1/AuthenticationA
lines 2850-2910/2910 (END)

Run systemctl status PostgreSQL.service, got this firstcallonline information:

● postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2017-07-19 04:30:26 EDT; 42min ago
  Process: 27285 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=1/FAILURE)
  Process: 27280 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 26640 (code=exited, status=0/SUCCESS)
1 Reply
abhinavmishra14
Advanced

Re: PostgreSQL service start failed on CentOS 7

Not exactly sure if you have missed any steps. I could see you have not initialized db. However have a look at the detailed steps here: https://javaworld-abhinav.blogspot.com/2021/02/setup-acs62-ga-and-ass14-distribution-stepbystep-cent...

Hope it helps.

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)