The solution to the problem of Home connection timeout
This morning, I found that the new home node reported an error and could not be connected, and some nodes found problems, indicating that the service problem was unlikely, so I thought it was the kernel parameter problem. Sure enough, because it is a new node, there is no optimization of the system. Now is the time to find the problem and record the process:
1. Check the connection status and summarize it.
Netstat-n | awk'/ ^ tcp/ {+ + S [$NF]} END {for (an in S) print a, S [a]}'
CLOSE_WAIT 42
ESTABLISHED 0
TIME_WAIT 1006
2. Optimize kernel parameters first
Vi / etc/sysctl.conf
Net.ipv4.tcp_syncookies = 1
Net.ipv4.tcp_tw_reuse=1 # allows TIME_WAIT status to be reused so that even if TIME_WAIT occupies all ports, it does not reject new requests and cause obstacles. The default is 0.
Net.ipv4.tcp_tw_recycle=1 # Let TIME_WAIT recycle default 0 as soon as possible
Net.ipv4.tcp_fin_timeout=30
/ sbin/sysctl-p # let the parameter take effect
3. Restart related java services
Although this is the common sense of the operation and maintenance staff to find the problem, it may be forgotten because of the change of environment. Record it here.