osm2pgsql 导入失败 "Failed to read from node cache: Input/output error"

osm2pgsql import fails with "Failed to read from node cache: Input/output error"

我正在尝试在 AWS EC2 上导入整个星球的 OSM 数据。在 "Ways" 处理期间或可能之后,我收到以下消息:

"Failed to read from node cache: Input/output error"

EC2 具有以下规格:

类型:i3.xlarge
内存:30.5 Gb
vCPU:4
PostgreSQL: v9.5.6
PostGIS:2.2

除了根卷外,我还安装了 900GB SSD 和 2TB HHD(高吞吐量)。 Postgresql 数据目录位于 HHD 上。我已经命令 osm2pgsql 将平面节点文件写入 SSD。

这是我的 osm2pgsql 命令:

osm2pgsql -c -d gis --number-processes 4 --slim -C 20000 --flat-nodes /data-cache/flat-node-cache/flat.nodes /data-postgres/planet-latest.osm.pbf

我 运行 作为以下组 renderaccount ubuntu postgres 的成员的用户 renderaccount 执行上述命令。 flat-nodes 文件似乎已在 /data-cache/flat-node-cache/flat.nodes 成功创建并具有此配置文件:

ubuntu@ip-172-31-25-230:/data-cache/flat-node-cache$ ls -l
total 37281800
-rw------- 1 renderaccount renderaccount 38176555024 Apr 13 05:45 flat.nodes

有没有人运行参与或解决了这个问题?我怀疑可能是权限问题?我现在注意到,自上次 osm2pgsql 失败以来,作为 flat-nodes 文件目标的已安装 SSD 已转换为 "read-only" 文件系统 - 这听起来可能会在有 i/o 已安装卷上的错误(?)。

此外,osm2pgsql 是否写入了我可以获得额外信息的日志?

更新dmesg 输出:

[ 6206.884412] blk_update_request: I/O error, dev nvme0n1, sector 66250752
[ 6206.890813] EXT4-fs warning (device nvme0n1): ext4_end_bio:329: I/O error -5 writing to inode 14024706 (offset 10871640064 size 8388608 starting block 8281600)
[ 6206.890817] Buffer I/O error on device nvme0n1, logical block 8281344

研究以上输出后,看来它可能是 Ubuntu 16.04 中的错误。 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1668129?comments=all

这是 Ubuntu 16.04 写入卷 nvme0n1 的错误。解决了这个 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1668129/comments/29