我在 VMware 上运行了 redhat,并为 kafka 部署了 docker 容器。当我尝试以 localhost:9021 身份从浏览器访问控制中心时,出现“连接已重置”错误。
Name Command State Ports
--------------------------------------------------------------------------------------
base /bin/sh Up 8083/tcp, 9092/tcp
connect /etc/confluent/docker/run Up 0.0.0.0:8083->8083/tcp, 9092/tcp
control-center /etc/confluent/docker/run Up 0.0.0.0:9021->9021/tcp
kafka-1 /etc/confluent/docker/run Up 9092/tcp
kafka-2 /etc/confluent/docker/run Up 9092/tcp
kafka-3 /etc/confluent/docker/run Up 9092/tcp
ksql-cli /bin/sh Up
ksql-server /etc/confluent/docker/run Up 0.0.0.0:8088->8088/tcp
rest-proxy /etc/confluent/docker/run Up 8082/tcp
schema-registry /etc/confluent/docker/run Up 8081/tcp
zk-1 /etc/confluent/docker/run Up 2181/tcp, 2888/tcp, 3888/tcp
zk-2 /etc/confluent/docker/run Up 2181/tcp, 2888/tcp, 3888/tcp
zk-3 /etc/confluent/docker/run Up 2181/tcp, 2888/tcp, 3888/tcp
试图通过 nmap 和 curl 到达端口。两者都给出如下回应。问题仅在于浏览器(chrome 和 firefox)。
[root@localhost confluent-ops]# nmap -p 9021 localhost
Starting Nmap 6.40 ( http://nmap.org ) at 2020-04-22 15:48 EDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00011s latency).
Other addresses for localhost (not scanned): 127.0.0.1
PORT STATE SERVICE
9021/tcp open panagolin-ident
Nmap done: 1 IP address (1 host up) scanned in 0.36 seconds
[root@localhost confluent-ops]# curl -vvv -X GET http://localhost:9021
* About to connect() to localhost port 9021 (#0)
* Trying ::1...
* Connected to localhost (::1) port 9021 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:9021
> Accept: */*
>