无法启动postgresql

问题描述 投票:0回答:1
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.

我做了类似于此处列出的相同步骤:https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-centos-7

我安装了root用户的一切,我应该像其他用户一样安装吗?

# 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.
postgresql centos7
1个回答
2
投票

对于运行postgresql需要切换用户到postgres

Su postgres 

Pg_ctl start 
© www.soinside.com 2019 - 2024. All rights reserved.