tcp—在redhat enterprise 7.x vmware中的docker容器上部署kafka群集时,无法打开control center浏览器

liwlm1x9  于 2021-06-04  发布在  Kafka
关注(0)|答案(1)|浏览(397)

我在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: */*
>
x7yiwoj4

x7yiwoj41#

您需要设置从vm到主机的端口转发,或者需要设置到vm的nat网络。
一般来说,我建议直接在主机上安装docker或使用 docker-machine 而不是一个完整的虚拟机

相关问题