打开Kafka与外界通信的端口 [英] Open a port for Kafka communication to the outside-world

查看:19
本文介绍了打开Kafka与外界通信的端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Azure 中有一个虚拟机(Linux 操作系统),上面有 Hortonworks,可以启动 Kafka.

I have a VM (Linux OS) in Azure which has Hortonworks on it, which launches Kafka.

  • Kafka 服务正在运行,我能够在 VM 内创建生产者和消费者.

  • Kafka service is running and I am able of creating producer and consumer inside the VM.

我有服务器 IP,我也可以使用 8080 端口登录 Ambari.

I have the server IP and I'm also able to log into Ambari using 8080 port.

当我尝试从 Java 应用程序向 Kafka 发送消息时,我在 60 秒后收到 TimoutEception.

When I am trying to send a message to Kafka from my Java application I get a TimoutEception after 60 seconds.

我需要做什么才能为来自 VM 外部的 Kafka 通信设置正确的端口?

What do I need to do in order to set the right port for Kafka communication from outside the VM?

我认为这里的主要问题是 Kafka 正在侦听本地 IP,而不是 VM IP (WAN).

I think that the m,ain issue here, is that Kafka is listening on local IP and not on the VM IP (WAN).

任何帮助将不胜感激...

Any help will be really appreciated...

推荐答案

您是否设置了 Kafka Advertising.host.name 和 Adverted.port 环境变量?这就是你向外界展示自己的方式.

Did you set Kafka advertised.host.name and advertised.port environment variables? That's how you present yourself to the outside world.

这篇关于打开Kafka与外界通信的端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆