栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

server closed the connection unexpectedly This probably means the server terminated abnormally

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

server closed the connection unexpectedly This probably means the server terminated abnormally

连接PostgresSQL报错:

/ # psql -U postgres -h 192.168.xx.xxx -p 5440 -d postgres
psql: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.

在这里,我用的是端口转发的方式连接的数据库。

  • 原因一:
    转发所用的端口被占用

用 netstat -ntlp|grep 5440(linux)
或lsof -i:5440(Mac)查看端口信息,被占用则 kill -9 5440或更换端口,重新连接,即可成功。

  • 原因二:
    Linux 内存过量使用

在 Linux 新版本中,由于内核实现内存过量使用的方法,如果PostgreSQL或其它进程的内存要求导致系统用光虚拟内存,那么内核可能会终止PostgreSQL的 postmaster 进程。

我们通过查看磁盘空间,并清理不需要的磁盘空间,重新连接,成功。

  • 原因三:

以上方法都未能解决的话,重启postgres服务吧。。。

原因四:

ip公网地址不稳定

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/869985.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号