-2

I installed postgres and tried to start postgres service but failed with errors

[root@c1152-node3 ~]# psql
psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

[root@c1152-node3 log]# service postgres start
    Redirecting to /bin/systemctl start postgres.service
    Failed to start postgres.service: Unit not found.

I spent two days trying to figure out what went wrong. Finally, I installed postgresql-server. I am still to start the postgres service. But at least now, I am getting meaningful response from service xxxx start command. Question:- What is the difference between below two packages?

Jul 31 17:39:56 Installed: postgresql-9.2.23-3.el7_4.x86_64
Aug 02 16:45:25 Installed: postgresql-server-9.2.23-3.el7_4.x86_64

Now:-

[root@c1152-node3 log]# systemctl status postgresql
● postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2018-08-02 16:46:35 UTC; 34min ago
  Process: 7817 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE)
Failed to get boot id: No such file or directory
Aso'K
  • 21
  • 6

2 Answers2

2

postgresql is the client, postgresql-server is the server. See also

rpm -qi postgresql postgresql-server
RalfFriedl
  • 3,008
  • 4
  • 12
  • 17
  • Thanks! Any pointers for the error I am getting while trying to start? I have already run [postgres@c1152-node3 log]$ initdb -D /usr/local/pgsql/data successfully – Aso'K Aug 02 '18 at 18:08
  • `journalctl -xe` after a failed start should show you log entries. Try running `/usr/bin/postgresql-check-db-dir` manually and check for error messages. – RalfFriedl Aug 02 '18 at 18:53
0

Thanks @RalfFriedl

I was finally able to start my postgres by logging as user postgres and run

pg_ctl start -D /usr/local/pgsql/data/ -l logfile

service postgresql start is still failing

Aso'K
  • 21
  • 6