当前位置:网站首页>数据库使用psql及jdbc进行远程连接,不定时自动断开的解决办法
数据库使用psql及jdbc进行远程连接,不定时自动断开的解决办法
2022-07-27 13:34:00 【瀚高PG实验室】
瀚高数据库
目录
环境
症状
问题原因
解决方案
环境
系统平台:Linux x86-64 Red Hat Enterprise Linux 7,Linux x86-64 Red Hat Enterprise Linux 6,银河麒麟U系(CPU飞腾)4
版本:4.5
症状
瀚高数据库在使用psql工具以及jdbc进行远程连接时,在经过一定时间之后报错-致命错误:
terminating connection due to client no input timeout。
排查安全参数,hg_clientnoinput = 0;
问题原因
操作系统TCP相关参数设置不正确,数据库沿用操作系统配置,导致TCP保活机制未生效。
解决方案
数据库做如下配置后,问题解决:
#以下参数默认值都为0,表示延用服务器的配置情况。
tcp_keepalives_idle = '60'
tcp_keepalives_interval = '20'
tcp_keepalives_count = '10'
参数相关说明:
tcp_keepalives_idle (integer)
规定在操作系统向客户端发送一个TCP keepalive消息后无网络活动的时间总量。 如果指定值时没有单位,则以秒为单位。值0(默认值)表示选择操作系统默认值。 指定不活动多少秒之后通过 TCP 向客户端发送一个 keepalive 消息。 0 值表示使用默认值。 这个参数只有在支持TCP_KEEPIDLE或等效套接字选项的系统或 Windows 上才可以使用。在其他系统上,它必须为零。在通过 Unix 域套接字连接的会话中,这个参数被忽略并且总是读作零。
tcp_keepalives_interval (integer)
规定未被客户端确认收到的TCP keepalive消息应重新传输的时间长度。 如果指定值时没有单位,则以秒为单位。值0(默认值)表示选择操作系统默认值。 这个参数只有在支持TCP_KEEPINTVL或等效套接字选项的系统或 Windows 上才可以使用。在其他系统上,必须为零。在通过 Unix域套接字连接的会话中,这个参数被忽略并总被读作零。
tcp_keepalives_count (integer)
指定服务器到客户端的连接被认为中断之前可以丢失的TCP keepalive消息的数量。值0(默认值)表示选择操作系统默认值。 这个参数只有在支持TCP_KEEPCNT或等效套接字选项的系统上才可以使用。在其他系统上,必须为零。在通过 Unix 域套接字连接的会话中,这个参数被忽略并总被读作零。
tcp_user_timeout (integer)
指定传输的数据在TCP连接被强制关闭之前可以保持未确认状态的时间量。 如果指定值时没有单位,则以毫秒为单位。值0(默认值)表示选择操作系统默认值。 这个参数只有在支持TCP_USER_TIMEOUT的系统上才被支持;在其他系统上,它必须为零。 在通过Unix-domain 套接字连接的会话中,此参数将被忽略并且始终读取为零。
服务器中相关的配置信息的方法:
[[email protected] ~]# cat /proc/sys/net/ipv4/tcp_keepalive_time
[[email protected] ~]# cat /proc/sys/net/ipv4/tcp_keepalive_intvl
[[email protected] ~]# cat /proc/sys/net/ipv4/tcp_keepalive_probes
边栏推荐
- Navicate reports an error access violation at address 00000000
- [popular science] the difference and connection between accuracy and resolution
- SLAM综述阅读笔记四:A Survey on Deep Learning for Localization and Mapping: Towards the Age of Spatial 2020
- "Game engine light in light out" 4.1 unity shader and OpenGL shader
- 自动化配置SSH免密登录和取消SSH免密配置脚本
- arduino+ZE08-CH2O甲醛模块,输出甲醛含量
- 文献翻译__tvreg v2:用于去噪、反卷积、修复和分割的变分成像方法(部分)
- [note] logistic regression
- aac 和 h264等的时间戳
- 大家最想要的,最全的C语言知识点总结,还不赶紧学习
猜你喜欢

Research on automatic classification of electronic medical records based on unbalanced data

知识关联视角下金融证券知识图谱构建与相关股票发现

10 practical uses of NFT

一篇文章看懂JS执行上下文

Toward fast, flexible, and robust low light image enhancement cvpr2022

Import the virtual machine officially made by Kali Linux into Oracle VirtualBox

股票买卖4

DVWA full level customs clearance tutorial

Ten thousand words detailed Google play online application standard package format AAB

文献翻译__tvreg v2:用于去噪、反卷积、修复和分割的变分成像方法(部分)
随机推荐
炒黄金开户平台有没有正规,安全的
Schematic diagram of C measuring tool
一篇文章看懂JS执行上下文
STM32 - capacitive touch button experiment
2022年中国网络视频市场年度综合分析
股票买卖4
Docker实践经验:Docker 上部署 mysql8 主从复制
How to make computers have public IP
Is the security of online brokerage app account opening guaranteed?
「游戏引擎 浅入浅出」4.1 Unity Shader和OpenGL Shader
Toward Fast, Flexible, and Robust Low-Light Image Enhancement(实现快速、灵活和稳健的弱光图像增强)CVPR2022
Lesson 3: reverse word order
这年头谁还不会抓包,WireShark 抓包及常用协议分析送给你!
<C> C语言哈希表使用
PROFINET simulator tutorial
JS what is declaration in advance? The order of function and variable declaration in advance (the foreshadowing of execution context)
@Bean 与 @Component 用在同一个类上,会发生什么?
Win11壁纸变黑怎么办?Win11壁纸变黑了的解决方法
Import the virtual machine officially made by Kali Linux into Oracle VirtualBox
Basic exercises of C language