Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting Kafka Server Permanently

Tags:

I have setup Kafka on Amazon EC2 instance.

I have done the following in below order: (1) SSH into the Instance (2) Start Zookeper (3) Start Kafka (4) Execute Producer and Consumer Programs.

Everything is working fine till here. However once I close the SSH window on which I have started Kafka, the Kafka service stops. I can no longer execute Producer and Consumer programs.

How can I have the Kafka Server permanently up for all requests, even after I close the SSH window.

Thank You.

like image 276
user1058797 Avatar asked Feb 14 '13 12:02

user1058797


People also ask

Can we start Kafka server without starting Zookeeper?

However, you can install and run Kafka without Zookeeper. In this case, instead of storing all the metadata inside Zookeeper, all the Kafka configuration data will be stored as a separate partition within Kafka itself.

Which of the following should be started before starting the Kafka server?

Kafka requires a Zookeeper server in order to run, so the first thing we need to do is start a Zookeeper instance.


2 Answers

This is now officially supported in kafka and zookeeper startup scripts. So if you are on latest (Since Aug 2015) kafka you can use -daemon as follows.

# ./kafka-server-start.sh USAGE: ./kafka-server-start.sh [-daemon] server.properties  # ./zookeeper-server-start.sh USAGE: ./zookeeper-server-start.sh [-daemon] zookeeper.properties 
like image 175
Atul Soman Avatar answered Sep 20 '22 15:09

Atul Soman


Try bin/kafka-server-start.sh -daemon config/server.properties.

OR:

Try upstart script here:upstart script for kafka

like image 32
BAE Avatar answered Sep 21 '22 15:09

BAE