Memo/fix-postgresql-shared-memory-segment-error

1 分钟阅读

解决 PostgreSQL `could not open shared memory segment` 错误

排查 PostgreSQL 无法打开共享内存段的问题。

解决 PostgreSQL could not open shared memory segment 错误。

打开 journalctl -u postgresql.service 可以看到:

Jun 15 11:55:52 fanyang-legion postgres[322924]: 2025-06-15 11:55:52.856 CST [322924] ERROR:  could not open shared memory segment "/PostgreSQL.2816709408": No such file or directory
Jun 15 11:56:52 fanyang-legion postgres[322973]: 2025-06-15 11:56:52.914 CST [322973] ERROR:  could not open shared memory segment "/PostgreSQL.2816709408": No such file or directory
Jun 15 11:57:52 fanyang-legion postgres[323026]: 2025-06-15 11:57:52.975 CST [323026] ERROR:  could not open shared memory segment "/PostgreSQL.2816709408": No such file or directory
Jun 15 11:58:53 fanyang-legion postgres[323076]: 2025-06-15 11:58:53.034 CST [323076] ERROR:  could not open shared memory segment "/PostgreSQL.2816709408": No such file or directory
Jun 15 11:59:53 fanyang-legion postgres[323127]: 2025-06-15 11:59:53.042 CST [323127] ERROR:  could not open shared memory segment "/PostgreSQL.2816709408": No such file or directory
Jun 15 12:00:53 fanyang-legion postgres[323181]: 2025-06-15 12:00:53.099 CST [323181] ERROR:  could not open shared memory segment "/PostgreSQL.2816709408": No such file or directory
Jun 15 12:01:53 fanyang-legion postgres[323229]: 2025-06-15 12:01:53.155 CST [323229] ERROR:  could not open shared memory segment "/PostgreSQL.2816709408": No such file or directory
Jun 15 12:02:53 fanyang-legion postgres[323286]: 2025-06-15 12:02:53.193 CST [323286] ERROR:  could not open shared memory segment "/PostgreSQL.2816709408": No such file or directory
Jun 15 12:03:53 fanyang-legion postgres[323334]: 2025-06-15 12:03:53.219 CST [323334] ERROR:  could not open shared memory segment "/PostgreSQL.2816709408": No such file or directory
Jun 15 12:04:53 fanyang-legion postgres[323385]: 2025-06-15 12:04:53.232 CST [323385] ERROR:  could not open shared memory segment "/PostgreSQL.2816709408": No such file or directory
Jun 15 12:05:04 fanyang-legion postgres[323386]: 2025-06-15 12:05:04.501 CST [323386] FATAL:  could not open shared memory segment "/PostgreSQL.2816709408": No such file or directory

解决方法:

PostgreSQL 11 Shared Memory Error: could not open shared memory segment "/PostgreSQL.XXXXXXXX": No such file or directory

# sudo vim /etc/systemd/logind.conf
RemoveIPC=no
systemctl restart systemd-logind.service

相关阅读

Memo关闭侧信道攻击缓解,make Linux great again!Memotime-warp-test.c: check TSC synchronity on x86 CPUsMemo通过 SSH 迁移 btrfs volumes

讨论

邮箱用于身份识别和回复通知,并由 Waline 存储。