patternsqlMinor
PostgreSQL service start failed on CentOS 7
Viewed 0 times
postgresqlcentosservicefailedstart
Problem
Installed PostgreSQL using:
PostgreSQL version: 9.2.18
When start service:
Got error:
The
```
-- Unit postgresql.service has failed.
--
-- The result is failed.
7月 19 04:17:04 node2 systemd[1]: Unit postgresql.service entered failed state.
7月 19 04:17:04 node2 systemd[1]: postgresql.service failed.
7月 19 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
7月 19 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
7月 19 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.
7月 19 04:19:34 node2 pg_ctl[27187]: pg_ctl: could not start server
7月 19 04:19:34 node2 pg_ctl[27187]: Examine the log output.
7月 19 04:19:34 node2 systemd[1]: postgresql.service: control process exited, code=exited status=1
7月 19 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.
7月 19 04:19:34 node2 systemd[1]: Unit postgresql.service entered failed state.
7月 19 04:19:34 node2 systemd[1]: postgresql.service failed.
7月 19 04:19:34 node2 polkitd[1977
sudo yum install postgresql-server postgresql-contribPostgreSQL version: 9.2.18
When start service:
sudo service postgresql startGot 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.
7月 19 04:17:04 node2 systemd[1]: Unit postgresql.service entered failed state.
7月 19 04:17:04 node2 systemd[1]: postgresql.service failed.
7月 19 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
7月 19 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
7月 19 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.
7月 19 04:19:34 node2 pg_ctl[27187]: pg_ctl: could not start server
7月 19 04:19:34 node2 pg_ctl[27187]: Examine the log output.
7月 19 04:19:34 node2 systemd[1]: postgresql.service: control process exited, code=exited status=1
7月 19 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.
7月 19 04:19:34 node2 systemd[1]: Unit postgresql.service entered failed state.
7月 19 04:19:34 node2 systemd[1]: postgresql.service failed.
7月 19 04:19:34 node2 polkitd[1977
Solution
You have 3 steps before being abble to connect to a PostgreSQL Database:
You already installed PostgreSQL, you need now to create the cluster. The
You will find documentation here.
It might be confusing because when you're under a debian based distros,
- Install PostgreSQL
- Create the data cluster ($PGDATA)
- Start the server
You already installed PostgreSQL, you need now to create the cluster. The
initdb tool is what you need.You will find documentation here.
It might be confusing because when you're under a debian based distros,
apt and perl wrappers do every steps for you.Context
StackExchange Database Administrators Q#180209, answer score: 3
Revisions (0)
No revisions yet.