Reputation: 1864
root@instance $ 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 Mon 2018-03-05 02:57:55 UTC; 10s ago
Process: 1116 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited, status=1/FAILURE)
Process: 1111 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Mar 05 02:57:54 instance-1 systemd[1]: Starting PostgreSQL database server...
Mar 05 02:57:55 instance-1 systemd[1]: postgresql.service: control process exited, code=exited status=1
Mar 05 02:57:55 instance-1 systemd[1]: Failed to start PostgreSQL database server.
Mar 05 02:57:55 instance-1 systemd[1]: Unit postgresql.service entered failed state.
Mar 05 02:57:55 instance-1 systemd[1]: postgresql.service failed.
I did about the same steps listed here: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-centos-7
I installed everything as root
user, should I install as other user?
# pg_ctl reload
pg_ctl: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.
Upvotes: 0
Views: 4316
Reputation: 862
For run postgresql need to Switch user to postgres
Su postgres
And
Pg_ctl start
Upvotes: 2