[英]How to configure postgresql server
恢复整个服务器文件后,我无法连接我的postgerSQL数据库。 在大量关于stackoverflow的教程和答案之后,我做了一些步骤来修复,但不幸的是,我得到了下面的提示:我的postgresql服务器正在运行,但是我无法通过psql访问
$ sudo service postgresql start
$ sudo service postgresql status
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; ve
Active: active (exited) since Fri 2019-08-30 15:09:21 UTC; 2s ago
Process: 3669 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 3669 (code=exited, status=0/SUCCESS)
Aug 30 15:09:21 unicalkg systemd[1]: Starting PostgreSQL RDBMS...
Aug 30 15:09:21 unicalkg systemd[1]: Started PostgreSQL RDBMS.
$ sudo -u postgres 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.5433"?
$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log
file
10 main 5433 down <unknown> /var/lib/postgresql/10/main
/var/log/postgresql/postgresql-10-main.log
$ sudo systemctl start postgresql@10-main
Job for postgresql@10-main.service failed because the service did
not take the steps required by its unit configuration.
See "systemctl status postgresql@10-main.service" and "journalctl -
xe" for details.
$ systemctl status postgresql@10-main.service
postgresql@10-main.service - PostgreSQL Cluster 10-main
Loaded: loaded (/lib/systemd/system/postgresql@.service; indirect;
Active: failed (Result: protocol) since Sat 2019-08-31 13:04:16 UTC
Process: 15725 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-red
lines
请帮我解决我的问题。
毕竟发现试图找到解决这个问题的方法。 幸运的是,我刚刚在服务器中找到了数据库备份。 然后我只是删除了postgres,重新安装后,我从备份中恢复了数据库。 因此,一切都完美。 建议! 定期进行服务器备份,至少要备份数据库:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.