首页 > 数据库 >解决postgres数据库remaining connection slots are reserved for non-replication superuser connectio

解决postgres数据库remaining connection slots are reserved for non-replication superuser connectio

时间:2024-05-23 10:08:20浏览次数:8  
标签:opt superuser non reserved postgres helper connection

来源:【小工具】 - 解决postgres数据库remaining connection slots are reserved for non-replication superuser connectio-CSDN博客

psycopg2.OperationalError: FATAL: remaining connection slots are reserved for non-replication superuser connection

报错信息

Traceback (most recent call last):
  File "/opt/wavepoint/agent/main.py", line 9, in <module>
    from monitor import moduleMonitor
  File "/opt/wavepoint/agent/monitor/moduleMonitor.py", line 26, in <module>
    from helper.helper_postgresql import postgres_helper
  File "/opt/wavepoint/agent/helper/helper_postgresql.py", line 15, in <module>
    postgres_helper = DBHelper(
  File "/opt/wavepoint/agent/helper/helper_db.py", line 26, in __init__
    self.get_client()
  File "/opt/wavepoint/agent/helper/helper_db.py", line 151, in get_client
    connection = psycopg2.connect(
  File "/opt/wavepoint/data-engine/external-libraries/psycopg2/__init__.py", line 127, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  remaining connection slots are reserved for non-replication superuser connections

问题分析
从字面意思理解来看,是由于超级用户连接数过多导致的问题。可以增加超级用户连接数限制,或者改用非超级用户进行业务操作(最大连接数设置大一些,比如20000)。

解决方案
解决方案一、增加超级用户连接数
vi /var/lib/postgresql/data/postgresql.conf

max_connections = 20000             
superuser_reserved_connections = 10000    
reserved_user_name = 'airflow' 
解决方案二、增加普通用户连接数

vi /var/lib/postgresql/data/postgresql.conf

max_connections = 20000             
superuser_reserved_connections = 100    
reserved_user_name = 'postgres' 

reserved_user_name为系统内置用户。 

  

标签:opt,superuser,non,reserved,postgres,helper,connection
From: https://www.cnblogs.com/yibinboy/p/18207733

相关文章

  • MySQL报错:SELECT list is not in GROUP BY clause and contains nonaggregated colum
    报错截图解决方法:修改数据库配置1.查看.sql_mode配置select@@global.sql_mode;2.查看返回信息是否包含ONLY_FULL_GROUP_BYONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION;3.去掉ONLY_FULL_GROUP_BY,其他参数不变,执行即可SETGLOBALsql_mode=‘STRI......
  • 非政府组织是英文Non-Governmental Organizations的意译,英文缩写NGO
    非政府组织是英文Non-GovernmentalOrganizations的意译,英文缩写NGO。 20世纪80年代以来,人们在各种场合越来越多地提及非政府组织(NGO)与非营利组织(NPO),把非政府组织与非营利组织看作在公共管理领域作用日益重要的新兴组织形式。著名非政府组织有福特基金会、景星学社、中国科学技......
  • flutter 运行ios真机测试 提示 Command PhaseScriptExecution failed with a nonzero
    我这边引起CommandPhaseScriptExecutionfailedwithanonzeroexitcode的原因是我刚更换了推送证书,于是我打开钥匙串访问发现推送证书处于不受信任状态,于是把证书状态设置为信任状态并删除了旧的推送证书,设置完成后再去运行,就可以成功运行了。这是我这边的单一情况,......
  • 部署freeipa中报错:Command '/bin/systemctl start certmonger.service' returned non-
    cat/etc/dbus-1/system.d/certmonger.conf<allowsend_destination="org.fedorahosted.certmonger"send_interface="org.fedorahosted.certmonger"/><allowsend_destination="org.fedorahosted.certmonger"......
  • 对non-bpm生僻字的处理
    1,问题有一个接口返回的字符串中有生僻字,但是mysql表用的字符集是utf8即utf8mb3,报错是###Cause:java.sql.SQLException:Incorrectstringvalue:'\xF0\xA8\xBA\x93\xE7\x94...'forcolumn'response_json'atrow1;uncategorizedSQLException;SQLstate[HY000];......
  • CF1967D Long Way to be Non-decreasing 题解
    CF1967DLongWaytobeNon-decreasing题解知识点二分答案,基环树。题意分析给定一个包含\(n\)个元素的数组\(\{a_i\}\)和一个\(m\)个元素的数组\(\{b_i\}\)。定义每次操作为:在\(\{a_i\}\)中选择任意个数,假设某个选的数为\(a_i\),那么将其变为\(b_{a_i}\)......
  • mysql使用group by查询报错SELECT list is not in GROUP BY clause and contains nona
    官方解释:ONLY_FULL_GROUP_BY是MySQL数据库提供的一个sql_mode,通过这个sql_mode来保证,SQL语句“分组求最值”合法性的检查.这种模式采用了与Oracle、DB2等数据库的处理方式。即不允许selecttargetlist中出现语义不明确的列.对于用到GROUPBY的select语句,查出......
  • ubuntu22 python2 pyinstaller 打包报错:'NoneType' object has no attribute 'groups'
    前言最近有个需求,需要在ubnutu22上使用pyinstaller打包一个python2的文件。中间遇到了一些问题:pip2installpyinstaller报错解决方案:pip2installpyinstaller==3.6python2和python3的pyinstaller如何同时存在,我想把python2的pyinstaller命名为pyin......
  • TextClip构造方法报OSError:MoviePy creation of None failed because of the followi
    在使用moviepy的构造方法创建实例时报错:这可能是两个原因导致的:未安装ImageMagick应用ImageMagick是一套功能强大、稳定而且开源的多平台工具集和开发包,可以用来读、写和处理超过200种基本格式的图片文件,包括PNG,JPEG,GIF,HEIC,TIFF,DPX,EXR,WebP,Postscript,PDF和SVG等格式。利用ImageM......
  • CodeForces 1967D Long Way to be Non-decreasing 题解
    题意简述yzh喜欢单调不降序列。她有一个序列\(a\),最初为\(a_1,\ldots,a_n\),其中每个元素都在\([1,m]\)内。她希望使序列变得单调不降,为此,她有一个序列$b_1\ldotsb_m$,每个元素也在\([1,m]\)内。她可以进行若干次操作,一次操作定义为:选择一个集合\(S\subseteq......