现象
启动报错
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 waiting
pg_ctl: could not start server
Examine the log output.
主要报错:FATAL: ?could not map anonymous shared memory: Cannot allocate memory
字面意思内存不够用于分配shared memory大小,即shared memory设置超出了所能分配到的内存大小
查看内存
?查看配置
查看路径:locate postgresql.conf
配置参考路径:data/postgresql.conf
?
原来设置的推荐shared_buffers为总内存的25%,但是由于后续该机器装了其他程序,导致内存吃紧,所以只有降低大小,才能满足启动需求
|