![Postgresql 无法在 ubuntu 16.04 上启动](https://linux22.com/image/1152476/Postgresql%20%E6%97%A0%E6%B3%95%E5%9C%A8%20ubuntu%2016.04%20%E4%B8%8A%E5%90%AF%E5%8A%A8.png)
我刚刚在 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 吗?
谢谢