现象
启动报错
waiting for server to start....2022-03-11 16:52:05.485 CST [56148] LOG: starting PostgreSQL 12.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit
2022-03-11 16:52:05.485 CST [56148] LOG: listening on IPv4 address "0.0.0.0", port 5432
2022-03-11 16:52:05.485 CST [56148] LOG: listening on IPv6 address "::", port 5432
2022-03-11 16:52:05.487 CST [56148] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"
2022-03-11 16:52:05.488 CST [56148] FATAL: could not map anonymous shared memory: Cannot allocate memory
2022-03-11 16:52:05.488 CST [56148] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory, swap space, or huge pages. To reduce the request size (currently 34628599808 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
2022-03-11 16:52:05.488 CST [56148] LOG: database system is shut down
stopped w

博客内容讲述了在启动PostgreSQL数据库时遇到'FATAL: could not map anonymous shared memory'错误的原因和解决方案。问题源于PostgreSQL请求的共享内存超过了系统可用内存。建议检查并调整配置文件postgresql.conf中的shared_buffers参数,降低其大小以适应系统资源。同时,考虑减少max_connections等占用内存的设置。
最低0.47元/天 解锁文章
8169

被折叠的 条评论
为什么被折叠?



