Apache Kafka VirtualBox: Transferring data from VM to host PC results in error connecting to node


BluekaiTheEnd

I have recently started using Apache Kafka and have successfully sent data from producers to consumers on Windows 10 and my Linux Mint 19.3 (VM) environment. Now I want to stream data from the virtual machine to the Windows 10 environment.

Both environments can ping each other.

When I try to run the consumer on Windows 10, I get "Error connecting node VM-VirtualBox: 9092'" followed by "java.net.UnknownHostException: VM-VirtualBox". Oddly, Windows 10 is able to view the topics listed in the virtual machine environment. And I am able to create and delete themes from Windows. But I can't connect.

Can someone point out what I'm doing wrong?

My server.properties contains the following lines:

broker.id=0
Kafka Broker Advanced Configuration
Snippet (Safety Valve)
############################# Socket Server Settings #############################
# The address the socket server listens on. It will get the value returned from
# java.net.InetAddress.getCanonicalHostName() if not configured.
# FORMAT:
# listeners = listener_name://host_name:port
# EXAMPLE:
# listeners = PLAINTEXT://your.host.name:9092
#port=9092
#advertised.host.name=localhost
listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners = PLAINTEXT://VM-VirtualBox:9092
#advertised.listeners = PLAINTEXT://Windows10-7950:9092
domain:9092

I also posted it on Reddit : https://www.reddit.com/r/apachekafka/comments/emqbms/virtualbox_streaming_data_from_vm_to_host_pc/

cricketer

If Kafka is running on the host, you need to advertise the hostname of the host or some address that the VM can resolve (could also be an IP address)

listeners=PLAINTEXT://0.0.0.0:9092
advertised.listeners = PLAINTEXT://EXTERNAL-HOST:9092

Otherwise, you will need to edit the hosts file in the operating system so that the DNS name is recognized

The reason you can list and create topics is because you're probably using Zookeeper, not the bootstrap address

Related


Unable to connect to VirtualBox VM from Kubuntu host using NAT

Gilberts I am using Kubuntu 13 as host and Xubuntu 12 as guest. In the VM network options, I selected NAT, and like 127.0.0.1:23 => 10.0.2.15:22. I can access the internet from the guest, but when I try to SSH to the guest, I get connection refused. Recently I

Remote host pingable from Mac but not from Virtualbox VM

Arjun I have a remote that I can ping from the Macbook terminal. However, when I start the VirtualBox Ubuntu 16.04 VM and ping the same remote host, it fails to ping and I get the error "target host unreachable". Also, when I do this, I'm on the company's VPN,

Can't access Apache on VirtualBox VM (using NAT + host only)

Said Muhammad| short introduction: My host OS is Ubuntu-12.04 and have setup a virtual machine of Oracle Linux 6.4 (RHEL based) with Apache httpd web server using VirtualBox. I need to access a web page served by a VM from the host Ubuntu. Additional details:

Can't access Apache on VirtualBox VM (using NAT + host only)

Said Muhammad| short introduction: My host OS is Ubuntu-12.04 and have setup a virtual machine of Oracle Linux 6.4 (RHEL based) with Apache httpd web server using VirtualBox. I need to access a web page served by a VM from the host Ubuntu. Additional details:

How to access Apache2 virtual host from VirtualBox (or any VM)

hail I'm running Ubuntu 11.04 and have set up localhost so my website can be accessed via site1.local site2.local By setting up a virtual host and adding the entry to my hosts file. I want to test them in IE, so I have VirtualBox installed on Windows. My

Connecting to VirtualBox guest (ubuntu) from host (osx) via NAT?

Evenk I have a VirtualBox guest (running Ubuntu) configured with NAT through my host laptop (running OSX). From what I understand, with NAT configured, I can access the guest from the host machine (without any port forwarding magic), but not from any external

Retrieving data from af::array via host() results in data error

Arc lupus When trying to retrieve data from the device via af::array( arrayfire ) host(), my output data on the host is wrong (i.e. wrong value). To test, I wrote a small code example (based on https://stackoverflow.com/a/29212923/2546099 ): int main(void) {

Run command on Ubuntu guest in VirtualBox VM from Windows host

that 88 I'm writing some code and I have an idea that should work, but I don't know how to make it work. I'm running some code with Wolfram Mathematica on a Windows host, but I have to export the files to a Linux based program running in an Ubuntu Virtualbox V

Network access to VirtualBox VM from network PC

Tharik Kanaka Well, I've setup a VM (labeled PC2) in the PC's Virtual Box, and I'm hosting a web service in the VM (IIS). PC2-Windows Server 2003 VM-Windows 7 x86 Now I want to access the web service from another PC (labeled PC1) in the network that PC1 has co

How to access Apache from host (on VirtualBox guest)?

urok93 I have Apache installed on an Ubuntu VM. When I go into the client machine and load Firefox, I can see that Apache is running fine when I browse to localhost. I want to access the same page through the host. I tried using the guest's IP address, but not

How to access Apache2 virtual host from VirtualBox (or any VM)

hail I'm running Ubuntu 11.04 and have set up localhost so my website can be accessed via site1.local site2.local By setting up a virtual host and adding the entry to my hosts file. I want to test them in IE, so I have VirtualBox installed on Windows. My

Remote host pingable from Mac but not from Virtualbox VM

Arjun I have a remote that I can ping from the Macbook terminal. However, when I start the VirtualBox Ubuntu 16.04 VM and ping the same remote host, it fails to ping and I get the error "target host unreachable". Also, when I do this, I'm on the company's VPN,

Remote host pingable from Mac but not from Virtualbox VM

Arjun I have a remote that I can ping from the Macbook terminal. However, when I start the VirtualBox Ubuntu 16.04 VM and ping the same remote host, it fails to ping and I get the error "target host unreachable". Also, when I do this, I'm on the company's VPN,

Can't access Apache on VirtualBox VM (using NAT + host only)

Said Muhammad| short introduction: My host OS is Ubuntu-12.04 and have setup a virtual machine of Oracle Linux 6.4 (RHEL based) with Apache httpd web server using VirtualBox. I need to access a web page served by a VM from the host Ubuntu. Additional details:

Connecting to VirtualBox guest (ubuntu) from host (osx) via NAT?

Evenk I have a VirtualBox guest (running Ubuntu) configured with NAT through my host laptop (running OSX). From what I understand, with NAT configured, I can access the guest from the host machine (without any port forwarding magic), but not from any external

How to access Apache2 virtual host from VirtualBox (or any VM)

hail I'm running Ubuntu 11.04 and have set up localhost so my website can be accessed via site1.local site2.local By setting up a virtual host and adding the entry to my hosts file. I want to test them in IE, so I have VirtualBox installed on Windows. My

Network access to VirtualBox VM from network PC

Tharik Kanaka Well, I've setup a VM (labeled PC2) in the PC's Virtual Box, and I'm hosting a web service in the VM (IIS). PC2-Windows Server 2003 VM-Windows 7 x86 Now I want to access the web service from another PC (labeled PC1) in the network that PC1 has co

How to access Apache from host (on VirtualBox guest)?

urok93 I have Apache installed on an Ubuntu VM. When I go into the client machine and load Firefox, I can see that Apache is running fine when I browse to localhost. I want to access the same page through the host. I tried using the guest's IP address, but not