我真的迷失了这个。我的Django应用程序曾经工作,然后突然停止工作,当我启动服务器时,我得到了这个
django.db.utils.OperationalError: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
足够公平,所以现在我想检查postgres是否在运行以及在哪个端口上运行。这是我失去的地方,因为我无法找到它。以下表明它是:
service postgresql status
postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Thu 2017-11-16 13:29:37 GMT; 6s ago
Process: 7023 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 7023 (code=exited, status=0/SUCCESS)
这给了我一些信息 ps aux | grep -i postgres
myuser+ 7985 0.0 0.0 14228 976 pts/17 S+ 13:38 0:00 grep --color=auto -i postgres
但我不清楚这意味着什么,这给了我端口细节
sudo netstat -plunt
例如
roto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 1381/smbd
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 791/redis-server 0.
tcp 0 0 127.0.0.1:63342 0.0.0.0:* LISTEN 2415/java
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 1211/nginx.conf
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 841/dnsmasq
这里的配置文件:/etc/postgresql/9.5/main/postgresql.conf
说Postgres应该在5432上运行
我的总结是Postgres没有运行,但我不确定在哪里可以查看更多信息。有人可以帮忙吗?
由于
捐赠