![网络:端口侦听但 nc 失败](https://linux22.com/image/145270/%E7%BD%91%E7%BB%9C%EF%BC%9A%E7%AB%AF%E5%8F%A3%E4%BE%A6%E5%90%AC%E4%BD%86%20nc%20%E5%A4%B1%E8%B4%A5.png)
docker-compose
我在服务器上设置了一个堆栈。
其服务之一的jaeger collector
配置如下:
collector:
image: jaegertracing/jaeger-collector:1.8
environment:
- SPAN_STORAGE_TYPE=elasticsearch
- ES_SERVER_URLS=http://some-elk-address:9200
ports:
- "14269"
- "14268:14268"
- "14267"
- "14250"
- "9411:9411"
从我的机器:
$ nc -zv -w 2 server-hostname 9411
nc: connect to server-hostname port 9411 (tcp) failed: Connection refused
但是,从该服务器内部:
# ss -tula | grep 9411
tcp LISTEN 0 128 :::9411 :::*
答案1
该问题很可能与(如ss
上面的输出清楚暗示的那样)服务仅侦听 IPv6 连接有关
root@server-hostname:~/# ss -tula -4 | grep 9411
root@server-hostname:~/# ss -tula -6 | grep 9411
tcp LISTEN 0 128 :::9411 :::*