[英]Unable to connect to Kafka Broker on Hortonworks Sandbox (HDP 2.6) from my Windows Host Machine on Port 6667
I have downloaded Hortonworks Sandbox (IP: 192.179.144.XXX) on my Windows 10 laptop. 我已经在Windows 10笔记本电脑上下载了Hortonworks Sandbox(IP:192.179.144.XXX)。 I have the HDP Sandbox running on VMWare.
我在VMWare上运行了HDP沙箱。
Below is my sandbox information: 以下是我的沙箱信息:
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>
My goal is to be able to connect to Kafka (HDP Sandbox) from Java IntelliJ SDK based out of my Windows host machine. 我的目标是能够从Windows主机以外的Java IntelliJ SDK连接到Kafka(HDP沙箱)。
So far, I have tried the following in order to be able to access HDP Kafka from my host machine via Java and/or Kafka tool 1.0, but been unsuccessful. 到目前为止,为了通过Java和/或Kafka工具1.0从主机访问HDP Kafka,我尝试了以下方法,但未成功。
Updated the Network-Atapter to 'Host Only' in my VMware settings. 在我的VMware设置中,将网络适配器更新为“仅主机”。
Opened, Kafka broker, port number 6667 by adding the port number to the 'start_sandbox.sh' file. 通过将端口号添加到“ start_sandbox.sh”文件中,打开Kafka代理,端口号6667。 Leveraged the following article: http://tlxu.blogspot.com/2016/12/add-ports-mapping-to-hdp-25-vmware.html
利用以下文章: 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
However, when I open chrome on my laptop and try to connect to: http://192.179.144.XXX:6667 , I receive the following error: 但是,当我在笔记本电脑上打开Chrome浏览器并尝试连接到: http : //192.179.144.XXX : 6667时 ,出现以下错误:
This site can't be reached The webpage at http://192.179.144.XXX:6667/ might be temporarily down or it may have moved permanently to a web address. ERR_UNSAFE_PORT
I also tried 'logging' and 'telnetting' on the sandbox using "Putty" with following credentials: root@192.179.144.XXX and port: 6667. I receive the following error: 我还尝试使用具有以下凭据的“ Putty”在沙盒上“记录”和“登录”:root@192.179.144.XXX和端口:6667。我收到以下错误消息:
Network Error: software caused connection abort
Within the sandbox I ran the following command to check if the port is open inside the sandbox. 在沙盒中,我运行以下命令来检查端口是否在沙盒中打开。 I don't know what the output means, though.
我不知道输出是什么意思。
[root@sandbox ~]# netstat -tnlpa | grep 6667 [root@sandbox ~]#
Kafka properties in "Kafka Broker" section in Ambari has the following properties: Ambari的“ Kafka Broker”部分中的Kafka属性具有以下属性:
Kafka broker host: sandbox.hortonworks.com zookeeper.connect: sandbox.hortonworks.com:2181 listeners: PLAINTEXT://localhost:6667
(Please note: I also tried changing 'localhost' to '0.0.0.0', and my kafka-console-consumer and kafka-console-produer failed. Received "LEADER_NOT_AVAILABLE" error.) (请注意:我还尝试将“ localhost”更改为“ 0.0.0.0”,并且我的kafka-console-consumer和kafka-console-produer失败。收到“ LEADER_NOT_AVAILABLE”错误。)
Within Kafka properties in Ambari, I logged in as an Admin and added the following properties to the "Custom Kafka-broker" 在Ambari的Kafka属性中,我以管理员身份登录并将以下属性添加到“自定义Kafka经纪人”
advertised.port=6667 advertised.listeners=PLAINTEXT://sandbox.hortonworks.com:6667 advertised.host.name=192.179.144.XXX
I am unable to move forward, and I would really appreciate if anyone could help out on: 我无法前进,如果有人可以提供帮助,我将非常感谢:
1.) Is my port open? 1.)我的港口开放吗? If not, how else can I open the port?
如果没有,我该如何打开端口?
2.) Any additional changes I need to make with Kafka settings, that would let the Java IDE on my Windows to connect to Kafka (dependent on issue #1)? 2.)我需要对Kafka设置进行任何其他更改,这些更改会使Windows上的Java IDE连接到Kafka(取决于问题1)?
Kafka is not an HTTP service. Kafka不是HTTP服务。 Chrome, or browser, will not connect.
Chrome或浏览器将无法连接。
Kafka is not an SSH program. 这个不是SSH程序。 Putty, or other, will be connect.
腻子或其他将被连接。
You need to verify connection using kafka-console-*
tools from windows 您需要从Windows使用
kafka-console-*
工具验证连接
listeners: PLAINTEXT://localhost:6667
Should be the following for Kafka to listen externally of the sandbox 卡夫卡在沙盒外部监听时应遵循以下条件
listeners: PLAINTEXT://:6667
Then, I don't know about Host Only or NAT settings, but you shouldn't need to touch those if you setup port forwarding in the VM settings. 然后,我不知道“仅主机”或NAT设置,但是如果在VM设置中设置端口转发,则无需触摸这些设置。
advertised.host.name
Should not need to be changed in Ambari, but if you did, then set it to the sandbox hostname 不需要在Ambari中进行更改,但是如果您进行了更改,则将其设置为沙箱主机名
If you don't need Hadoop and all the other stuff in HDP, I suggest getting the HDF sandbox, or just using Docker for Windows and using the Kafka containers on DockerHub 如果您不需要Hadoop和HDP中的所有其他内容,建议您使用HDF沙箱,或者只使用Docker for Windows并在DockerHub上使用Kafka容器
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.