监控网络通信

yum install net-tools

scp -r /home/data/xl_tmp/*  root@192.168.2.51:/home/data/xl_tmp/

[root@hadoop1 ~]# ifconfig
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.50  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::a6bf:1ff:fe38:87e4  prefixlen 64  scopeid 0x20<link>
        ether a4:bf:01:38:87:e4  txqueuelen 1000  (Ethernet)
        RX packets 549401887  bytes 175359059861 (163.3 GiB)
        RX errors 0  dropped 12398  overruns 0  frame 0
        TX packets 541041732  bytes 285797506976 (266.1 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xb1200000-b127ffff 

eno2: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether a4:bf:01:38:87:e5  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xb1100000-b117ffff 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 23783784  bytes 19562119550 (18.2 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 23783784  bytes 19562119550 (18.2 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@hadoop1 ~]# netstat -n | grep 192.168.2.51
tcp        0      0 192.168.2.50:35986      192.168.2.51:22         ESTABLISHED
[root@hadoop1 ~]#

[root@hadoop1 conf]# ifconfig
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.51  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::a6bf:1ff:fe38:874e  prefixlen 64  scopeid 0x20<link>
        ether a4:bf:01:38:87:4e  txqueuelen 1000  (Ethernet)
        RX packets 269295218  bytes 298542167826 (278.0 GiB)
        RX errors 0  dropped 10609  overruns 0  frame 0
        TX packets 206849742  bytes 56847723549 (52.9 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xb1200000-b127ffff 

eno2: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether a4:bf:01:38:87:4f  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xb1100000-b117ffff 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 95544519  bytes 36666033920 (34.1 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 95544519  bytes 36666033920 (34.1 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@hadoop1 conf]# netstat -n | grep 192.168.2.50
tcp        0     72 192.168.2.51:22         192.168.2.50:35986      ESTABLISHED
[root@hadoop1 conf]#

iftop

http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858923.html

现象:接口响应时间突然异常大于1秒;top查看,存在突然出现的非常规网络通信进程,排查通信的另一方。

原文地址:https://www.cnblogs.com/rsapaper/p/8028807.html