Start Kafka (unable to canonicalize address localhost) - apache-kafka

I have a problem for start Kafka in VM Virtualbox. I'm using Virtual Box 6 with image Ubuntu 20.04. In Ubuntu i installed Kafka 2.12-2.31 (downloaded file .tgz).
When execute command for start Zookeeper, it running with success:
bin/zookeeper-server-start.sh config/zookeeper.properties
But, when execute command for start Kafka, it not running:
bin/kafka-server-start.sh config/server.properties
and error is show for me:
could someone help me please?
Thanks.

Related

Kafka service does not start

I am trying to install Kafka following a tutorial from DigitalOcean.com here.
I am doing this on Windows WSL2 with Ubuntu. So, after creating the zookeeper.service and kafka.service as per the tutorial, I do this command (the tutorial uses sudo systemctl start kafka instead), following advice from this thread:
sudo service kafka start
I received :
kafka: unrecognized service
When I do service --status-all to see if kafka is in the list, it is not there.
What am I missing?
There is lack of support in WSL for systemd
why systemd is disabled in WSL?

Run Script for Kafka in local machine

My project needs to kafka process. therefore, I downloded kafka_2.11-2.0.0 in my local machine. As you know, there are a lot of scripts for make this in bin directory, such as:
kafka-run-class.sh
kafka-topics.sh
kafka-server-start.sh
Which scripts are required to standing up Kafka ?
Unzip the tar.
Then issue these commands from inside the unzipped folder (you need to start zookeeper server first, then start kafka server):
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
This will start Apache Kafka with default configurations.

Kafka starting error in CentOS

Kafka server failed to start on confluent start command.
command lines:
~]# sudo confluent start
zookeeper is already running. Try restarting if needed
Starting kafka
-Kafka failed to start
kafka is [DOWN]
Cannot start Schema Registry, Kafka Server is not running. Check your deployment
Run
confluent log kafka
to see the log from Kafka trying to start, and see what the error is.

zookeper-server-start.sh config/zookeeper.properties is throwing "Already in use".how to solve this error in ubuntu?

Vfore starting kafka i tried to start zookeeper server,it is throwing following java.net.BindException Exception.
I checked existing processes using :
netstat -nap|grep 4040 and 8080
I found no processes running there. can anyone know about this?
screenshot
It's trying to start zookeeper on the default port of 2181. You probably have another zookeeper running. Try running the Java ps command "jps" and kill any other zookeeper process running on the same machine

How to setup kafka and zookeeper on your local machine?

I have installed kafka and zookeeper on my local C:\ drive folder now i am trying to run the zookeeper and kafka server so i can create topics but its throwing below error, any idea what is going wrong here ?
kafka comand Line:
C:\kafka_2.11-0.10.0.0>.\bin\windows\kafka-server-start.bat .\config\server.pro
erties
'#' is not recognized as an internal or external command,
operable program or batch file.
The syntax of the command is incorrect.
Error: missing `server' JVM at `C:\Program Files (x86)\Java\jre8\bin\server\jvm
dll'.
Please install or use the JRE or JDK that contains these missing components.
zookeeper.config
tickTime=2000
initLimit=10
syncLimit=5
dataDir=\zookeeper-3.4.8
clientPort=2181
Have you set up ZOOKEEPER_HOME in system variable ?
Please follow this video
https://www.youtube.com/watch?v=OJKesEpO6ok
In the latest version kafka_2.12-3.1.0 (2022) after unzipping and setting the properties and logs. keep the Kafka folder on the C drive and always run the command prompt with 'run as administrator'.
You can configure zookeeper with below commands
The .bat file is for windows
Terminal 1 zookeeper
C:\kafka\bin\windows>zookeeper-server-start.bat
..\..\config\zookeeper.properties
Terminal 2 Server
C:\kafka\bin\windows>kafka-server-start.bat
..\..\config\server.properties
Terminal 3 Creating a Topic
C:\kafka\bin\windows>kafka-topics.bat --create --topic tutorialGB
--bootstrap-server localhost:9092
Created topic tutorialGB.
To checklist of topic created
C:\kafka\bin\windows>kafka-topics.bat --list --bootstrap-server
localhost:9092
tutorialGB