Ubuntu 20下PostgreSQL 16日志中频繁出现 Shared Memory Error: could not open shared memory segment "/PostgreSQL.XXXXXXXX": No such file or directory
笔者在本地VM创建的虚拟机环境测试PostgreSQL的时候,部分虚拟机中的PostgreSQL的日志中频繁出现Shared Memory Error: could not open shared memory segment "/PostgreSQL.XXXXXXXX": No such file or directory。奇怪的是所有的VM虚拟机都是克隆出来的,而大部分虚拟机从来没有出现过这个错误,只有少部分虚拟机会频繁出现这个错误。
OS系统Ubuntu 20:
postgres@ubuntu05:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
PostgreSQL版本16.4
解决方案参考:https://stackoverflow.com/questions/56954665/postgresql-11-shared-memory-error-could-not-open-shared-memory-segment-postgr。
也即增加一个RemoveIPC=no的配置,笔者已尝试过并且该方案可行。
vi /etc/systemd/logind.conf
#added the Line
RemoveIPC=no
#and restart the service
systemctl restart systemd-logind.service
浙公网安备 33010602011771号