Paths are correct, I don’t know why I can’t start kafka service, all lines, log files, etc and do not say what the Issue is… :/
I’m trying to install kafka on my Centos 7/8 and there is no Issue description I can figure out.
zookeeper.service file:
[Unit]
Requires=network.target remote-fs.target
After=network.target remote-fs.target
[Service]
Type=simpleUser=kafka
ExecStart=/home/kafka/kafka/bin/zookeeper-server-start.sh /home/kafka/kafka/config/zookeeper.properties
ExecStop=/home/kafka/kafka/bin/zookeeper-server-stop.shRestart=on-abnormal
[Install]
WantedBy=multi-user.target
kafka.service file:
[Unit]
Requires=zookeeper.service
After=zookeeper.service
[Service]
Type=simple
User=kafka
ExecStart=/bin/sh -c '/home/kafka/kafka/bin/kafka-server-start.sh /home/kafka/kafka/config/server.properties > /home/kafka/kafka/kafka.log 2>&1'
ExecStop=/home/kafka/kafka/bin/kafka-server-stop.shRestart=on-abnormal
[Install]
WantedBy=multi-user.target
UPDATE: I was trying to solve kafka Issue when I sould check zookeeper service first. Please check the workaround below.
2
Answers
Ok I found the solution and I'm posting it because I saw a lot of questions regarding this Issue hoping I can also help them.
So, please check out the new command line ExecStart:
zookeeper.service file:
On Centos (7/8/ X Version) it needs to specify the batch like this (using /bin/sh -c ''):
After this, you can run the kafka service! :)
From Kafka docs Quickstart
Start zookeeper server with default settings
Start Kakfa server with default settings
If you had already done this step and still getting this error, Kafka server is unable to reach zookeeper service. Please check zookeeper server is running and listening on port mentioned (clientPort, default port: 2181) in zookeeper.properties file using anyone of the following commands – netstat, lsof, and telnet