Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AWS by (12.9k points)

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.

1 Answer

0 votes
by (18.2k points)

At the beginning of the command, nohup is required. that way the output will be in the file instead of the screen. You also need to add & at the end of the command to start the server in the background.

So, the commands should look like:

nohup bin/zookeeper-server-start.sh config/zookeeper.properties &

nohup bin/kafka-server-start.sh config/server.properties &

Related questions

0 votes
1 answer

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.1k users

Browse Categories

...