PostreSQL 10无法在Linux子系统的Windows子系统上运行的Ubuntu 18.04上启动

时间:2019-04-04 15:11:14

标签: database postgresql ubuntu windows-subsystem-for-linux

我最近使用适用于Linux的Windows子系统(WSL)在Windows 10上全新安装了Ubuntu 18.04。然后,我安装了PostgreSQL 10,并且能够成功启动数据库服务器。然后,我通过PGAdmin 4.4登录到服务器,并安装了PostGIS 2.5.2扩展。然后,当PGAdmin表示已失去与PostgreSQL服务器的连接时,我正要通过pg_restore导入数据。我尝试重新启动,但日志中出现以下错误:

2019-04-04 15:46:12.561 DST [47] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2019-04-04 15:46:12.561 DST [47] LOG:  listening on IPv6 address "::", port 5432
2019-04-04 15:46:12.563 DST [47] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2019-04-04 15:46:12.614 DST [48] LOG:  database system was shut down at 2019-04-04 15:42:36 DST
2019-04-04 15:46:12.661 DST [47] LOG:  database system is ready to accept connections
2019-04-04 15:46:13.247 DST [55] [unknown]@[unknown] LOG:  incomplete startup packet
2019-04-04 15:46:53.541 DST [49] PANIC:  could not flush dirty data: Function not implemented
2019-04-04 15:46:53.543 DST [47] LOG:  checkpointer process (PID 49) was terminated by signal 6: Aborted
2019-04-04 15:46:53.543 DST [47] LOG:  terminating any other active server processes
2019-04-04 15:46:53.543 DST [68] postgres@postgres WARNING:  terminating connection because of crash of another server process
2019-04-04 15:46:53.543 DST [68] postgres@postgres DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2019-04-04 15:46:53.543 DST [68] postgres@postgres HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2019-04-04 15:46:53.543 DST [52] WARNING:  terminating connection because of crash of another server process
2019-04-04 15:46:53.543 DST [52] DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2019-04-04 15:46:53.543 DST [52] HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2019-04-04 15:46:53.549 DST [47] LOG:  all server processes terminated; reinitializing
2019-04-04 15:46:53.569 DST [69] LOG:  database system was interrupted; last known up at 2019-04-04 15:46:12 DST
2019-04-04 15:46:53.569 DST [69] PANIC:  could not flush dirty data: Function not implemented
2019-04-04 15:46:53.575 DST [47] LOG:  startup process (PID 69) was terminated by signal 6: Aborted
2019-04-04 15:46:53.575 DST [47] LOG:  aborting startup due to startup process failure
2019-04-04 15:46:53.579 DST [47] LOG:  database system is shut down
2019-04-04 15:46:53.579 DST [70] postgres@postgres FATAL:  the database system is in recovery mode

我尝试重新安装Ubuntu 18.04和PostgreSQL 10,再次发生了同样的事情!我以前安装过上述安装程序,但工作正常。是否有人对导致此问题的原因有任何建议?

更新:A回答了以下问题。

2 个答案:

答案 0 :(得分:1)

因此,在进行了一些进一步的研究之后,我发现随着最新的PostgreSQL更新,先前的“无法刷新脏数据”警告已升级为“紧急情况”,我通过保留fsync = on并将data_sync_retry = true添加到postgresql.conf来解决了该问题。 。我希望这对遇到相同问题的其他人很有用。看来问题是已知的,以后会解决,请参见https://github.com/Microsoft/WSL/issues/645

答案 1 :(得分:0)

WSL似乎不支持PostgreSQL所需的所有系统调用。您是否尝试安装Windows版本?您可以在这里获得它:

https://www.postgresql.org/download/windows/