我刚刚在 ubuntu 16.04.1 上安装了 postgresql,但不幸的是它无法启动。
我使用以下方式安装它:
sudo apt-get install postgresql postgresql-contrib
但是运行 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"?
据我所知,服务器尚未启动,但我无法弄清楚原因:
$ systemctl status postgresql
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor prese
Active: active (exited) since Wed 2017-12-20 19:49:02 UTC; 1h 6min ago
Process: 1724 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 1724 (code=exited, status=0/SUCCESS)
Tasks: 0
Memory: 0B
CPU: 0
CGroup: /system.slice/postgresql.service
Dec 20 19:49:02 ov-36271c systemd[1]: Starting PostgreSQL RDBMS...
Dec 20 19:49:02 ov-36271c systemd[1]: Started PostgreSQL RDBMS.
pg_lsclusters 的输出:
$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
我尝试卸载并再次安装,但效果相同。有人能给我提示如何追踪此问题并运行 postgresql 吗?
谢谢