Hologres早上9点15分开始突然连不上了,是什么原因呢?
{"code":2100001000,"raw":{"data":{"code":null,"success":false,"data":null,"errCode":2100001000,"errMsg":"get table detail occurs FATAL: Connect to FE failed, remaining connection slots are reserved for non-replication superuser connections","requestId":"c0ca9bde-5d93-4c13-89fc-9994eba0cd6e"},"raw":{}},"request":{"url":"/rest/v0/table","data":{"connId":"1767363541654671362","dbName":"flowload","schemaName":"public","tableName":"amg_flowconfig_check_table_data"},"headers":{}},"response":{"data":{"data":{"code":null,"success":false,"data":null,"errCode":2100001000,"errMsg":"get table detail occurs FATAL: Connect to FE failed, remaining connection slots are reserved for non-replication superuser connections","requestId":"c0ca9bde-5d93-4c13-89fc-9994eba0cd6e"},"raw":{}}}}
是不是连接数打满了 https://help.aliyun.com/zh/hologres/user-guide/manage-connections?spm=a2c4g.11186623.0.i23
这个异常通常是由于连接数打满导致
解决方案:
可以通过Superuser账号连接实例,执行如下语句查看空闲连接是否过多。select * from pg_stat_activity where backend_type = 'client backend' and state = 'idle';
如果查询结果显示空闲进程过多,并且确定是无用的空闲连接时,可以找到上述语句结果中的pid字段,并执行如下语句释放空闲连接:
select pg_cancel_backend(); -- cancel该连接上的queryselect pg_terminate_backend(); --杀掉对应的后台连接进程--批量终止后台IDLE连接进程,释放连接SELECT pg_terminate_backend(pid) ,query ,datname ,usename ,application_name ,client_addr ,client_port ,backend_start ,stateFROM pg_stat_activityWHERE length(query) > 0AND pid != pg_backend_pid()AND backend_type = 'client backend'AND state = 'idle'AND application_name != 'hologres'AND usename != 'holo_admin'AND query not like '%pg_cancel_backend%';
此回答整理自钉群“实时数仓Hologres交流群”
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
本技术圈将为大家分析有关阿里云产品Hologres的最新产品动态、技术解读等,也欢迎大家加入钉钉群--实时数仓Hologres交流群32314975