PG(postgres)增加连接数异常处理

spark 连接PG报错:“sorry,too many clients already. ”
经过分析是PG连接数不够(之前使用的是默认连接数),在调大连接数的后,启动PG的过程又报了以下的异常:

This error does *not* mean that you have run out of disk space. It occurs when either the system limit for the maximum number of semaphore sets (SEMMNI), or the system wide maximum number of semaphores (SEMMNS), would be exceeded. You need to raise the respective kernel parameter. Alternatively, reduce PostgreSQL's consumption of semaphores by reducing its max_connections parameter.
 The PostgreSQL documentation contains more information about configuring your system for PostgreSQL.

经过查阅资料是系统信号量不够导致的PG无法启动.
解决方案:
执行以下命令

sysctl -w kernel.sem="500 5120000 2500 9000"

重启PG数据库
ok,

    原文作者:Anan9527
    原文地址: https://www.jianshu.com/p/5addd0b61733
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞