How does one view the connection creation time in linux?

Source: Internet
Author: User
In linux, how does one view the connection creation time when the zookeeper client loses the connection? our system will trigger an alarm. In this case, we need to go to the production environment to check the client connection, and check the connection creation time. Www.2cto.com use the following method: 1. view the connection in...
In linux, how does one view the connection creation time when the zookeeper client loses the connection? our system will trigger an alarm. In this case, we need to go to the production environment to check the client connection, and check the connection creation time. Www.2cto.com uses the following methods: 1. check the process ID of the connection. for details, see netstat-Treaty | grep port. you can obtain the process ID tcp 0 0: ffff: 192.168.251.43: 51520: ffff: 192.168.110.231: 8998 ESTABLISHED 32439/java 2. check the name of the connection opened by the process, lsof-p pid | grep port. you can obtain the connection file number of the process on this port: java 32439 root 118u IPv6 165707367 0t0 TCP SC-HOST-43: 51518-> 192.168.110.231: 8998 (ESTABLISHED) java 32439 root 126u IPv6 165707404 0t0 TCP SC-HOST-43: 51520-> 192.168.110.231: 899 8 (ESTABLISHED) you noticed that 118u and 126u are the names of the two connections, and then go to ll/proc/pid/fd/118 to see the connection establishment time.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.