繁体   English   中英

它无法在wsl(ubuntu)中重启postgresql

[英]It is unable to restart postgresql in wsl(ubuntu)

我在Windows上使用ubuntu 18.04。 我无法启动postgresql状态到网上。 当我刚刚安装了postgres 11时,状态在5433端口处于联机状态,似乎运行良好。 然后它下降了,再也没有上线了。

postgresql状态现在是

11/main (port 5433): down

当我尝试通过sudo pg_ctlcluster 11 main restartsudo /etc/init.d/postgresql restart ,那么错误代码如下所示。

Restarting PostgreSQL 11 database server
Error: /usr/lib/postgresql/11/bin/pg_ctl /usr/lib/postgresql/11/bin/pg_ctl 
start -D /var/lib/postgresql/11/main -l /var/log/postgresql/postgresql-11- 
main.log -s -o  -c config_file="/etc/postgresql/11/main/postgresql.conf"  
exited with status 1:
2019-04-02 19:36:27.783 DST [3195] LOG:  listening on IPv4 address 
"127.0.0.1", port 5433
2019-04-02 19:36:27.798 DST [3195] LOG:  listening on Unix socket 
"/var/run/postgresql/.s.PGSQL.5433"
2019-04-02 19:36:27.852 DST [3196] LOG:  database system was interrupted; 
last known up at 2019-04-02 18:39:14 DST
2019-04-02 19:36:27.853 DST [3196] PANIC:  could not flush dirty data: 
Function not implemented
2019-04-02 19:36:27.853 DST [3195] LOG:  startup process (PID 3196) was 
terminated by signal 6: Aborted
2019-04-02 19:36:27.853 DST [3195] LOG:  aborting startup due to startup 
process failure
2019-04-02 19:36:27.860 DST [3195] LOG:  database system is shut down
pg_ctl: could not start server
Examine the log output.

我认为这个问题与端口设置有关,所以我查了一些文件。 在/ etc / services中,postgresql设置为5432

postgresql      5432/tcp        postgres        # PostgreSQL Database
postgresql      5432/udp        postgres

在/etc/postgresql/11/main/postgresql.conf中,端口设置为5433

port = 5433 

我不知道为什么端口号彼此设置不同。 由于端口5432,5433上都没有运行,我真的不知道为什么postgresql无法继续在线状态。 如果有更多信息需要修复,请告诉我。

我遇到了同样的问题。

我只是将fsync选项off (此选项位于postgresql.conf文件中),然后一切都变好了。 这种解决方法很不适合生产环境。

检查这个细节:

https://askubuntu.com/questions/1121820/postgresql-not-starting

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM