大网数据广告活动
服务器运维问答

Netstat and ss doesn't see connection

· 52CE 我爱测

I'm trying to find which application running on Kubernetes cluster is using a specific port to communicate with RabbitMQ cluster. On RabbitMQ I see that connection is coming from 192.168.1.10:34226. 192.168.1.10 is one of Kuberne…

问题原文

原帖链接 · QkiZ · CC BY-SA 4.0

I'm trying to find which application running on Kubernetes cluster is using a specific port to communicate with RabbitMQ cluster. On RabbitMQ I see that connection is coming from 192.168.1.10:34226. 192.168.1.10 is one of Kubernetes nodes. After logging in to 192.168.1.10 I checked if connection is established from that node by tcpdump command tcpdump -i eth0 port 34226. I see traffic with both directions. Now I'm trying to find which process is making this connection. First I tried netstat:

netstat -tapn | grep 34226

and it found nothing. Then I tried ss but still nothing. Connection is established, with tcpdump I can see heartbeat packets sent to RabbitMQ and response from RabbitMQ. But netstat and ss don't report established connection.

UPDATE 1

I found that is something related to network namespaces. My question is similar to this question but I need to find PID of process which make connection from 34226 port.

已采纳解答

原帖链接 · QkiZ · CC BY-SA 4.0

After couple of weeks I found answer. I needed to run netstat -tapn in all namespaces with following command:

sudo ip -all netns exec netstat -tapn | grep 34226

Now I have PID number of process which start tcp connection from 34226 port.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-02-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。