【发布时间】:2019-05-09 14:22:07
【问题描述】:
我已经在我的 Windows 10 笔记本电脑上下载了 Hortonworks Sandbox(IP:192.179.144.XXX)。我在 VMWare 上运行 HDP 沙盒。
以下是我的沙盒信息:
Created on: 19_04_2017_19_09_16 for
Hadoop stack version: Hadoop 2.7.3.2.6.0.3-8
Ambari Version: 2.5.0.5-1
Ambari Hash: 0b5e975972e7a0b265e87b2e38eefde9039ef44c
Ambari build: Release : 1
Java version: 1.8.0_121
OS Version: CentOS release 6.9 (Final)</code>
我的目标是能够从基于我的 Windows 主机的 Java IntelliJ SDK 连接到 Kafka(HDP 沙盒)。
到目前为止,为了能够通过 Java 和/或 Kafka 工具 1.0 从我的主机访问 HDP Kafka,我已经尝试了以下方法,但没有成功。
在我的 VMware 设置中将网络适配器更新为“仅限主机”。
-
通过将端口号添加到“start_sandbox.sh”文件中,打开 Kafka 代理,端口号 6667。利用以下文章:http://tlxu.blogspot.com/2016/12/add-ports-mapping-to-hdp-25-vmware.html
2.1 Below are the steps taken to "open" the port 6667 - 2.1.1) login to the Sandbox VM (actual docker container) 2.1.2) Disable sandbox.service: $ systemctl disable sandbox.service 2.1.3) Reboot the VM: $ init 6 2.1.4) Modify sandbox start script: $ vi /root/start_scripts/start_sandbox.sh 2.1.5) Added "-p 6667:6667 \" after "-p 2222:22 \" 2.1.6) save and exit. 2.1.7) Delete existing sandbox container: $ docker rm sandbox 2.1.8) Enable sandbox.service: systemctl enable sandbox.service 2.1.9) Reboot the VM: $ init 6 2.1.10) Verify new ports: $ docker ps | grep 6667 2.1.11) Received the following output - 0.0.0.0:6667->6667/tcp -
但是,当我在笔记本电脑上打开 chrome 并尝试连接到:http://192.179.144.XXX:6667 时,我收到以下错误:
This site can’t be reached The webpage at @987654323@ might be temporarily down or it may have moved permanently to a web address. ERR_UNSAFE_PORT -
我还尝试使用“Putty”在沙盒上“记录”和“远程登录”,并使用以下凭据:root@192.179.144.XXX 和端口:6667。我收到以下错误:
Network Error: software caused connection abort -
在沙箱中,我运行了以下命令来检查端口是否在沙箱中打开。不过,我不知道输出是什么意思。
[root@sandbox ~]# netstat -tnlpa | grep 6667 [root@sandbox ~]# -
Ambari 中“Kafka Broker”部分中的 Kafka 属性具有以下属性:
Kafka broker host: sandbox.hortonworks.com zookeeper.connect: sandbox.hortonworks.com:2181 listeners: PLAINTEXT://localhost:6667(请注意:我也尝试将 'localhost' 更改为 '0.0.0.0',但我的 kafka-console-consumer 和 kafka-console-produer 失败。收到“LEADER_NOT_AVAILABLE”错误。)
-
在 Ambari 的 Kafka 属性中,我以管理员身份登录并将以下属性添加到“自定义 Kafka-broker”
advertised.port=6667 advertised.listeners=PLAINTEXT://sandbox.hortonworks.com:6667 advertised.host.name=192.179.144.XXX
我无法继续前进,如果有人能提供帮助,我将不胜感激:
1.) 我的端口是否开放?如果没有,我还能如何打开端口?
2.) 我需要对 Kafka 设置进行任何其他更改,以使我的 Windows 上的 Java IDE 连接到 Kafka(取决于问题 #1)?
【问题讨论】:
-
不,端口已关闭。您将不得不查看日志以找出原因。试试
systemctl status sandbox.service。
标签: apache-kafka vmware hortonworks-sandbox