0% found this document useful (0 votes)
1 views

Commands

This document provides a series of command-line instructions for managing Kafka, Flink, and Logstash services. It includes commands for starting and stopping servers, creating and deleting topics, producing and consuming data, and managing Flink jobs. Additionally, it outlines how to edit configuration files and run Logstash with specific configurations.

Uploaded by

gchetan8008
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Commands

This document provides a series of command-line instructions for managing Kafka, Flink, and Logstash services. It includes commands for starting and stopping servers, creating and deleting topics, producing and consuming data, and managing Flink jobs. Additionally, it outlines how to edit configuration files and run Logstash with specific configurations.

Uploaded by

gchetan8008
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Commands

#Kafka

#Starting the server

./kafka/bin/kafka-server-start.sh ~/kafka/config/kraft/server.properties

#Stop the server

./kafka/bin/kafka-server-stop.sh

#Listing all the topics

./kafka/bin/kafka-topics.sh --list --bootstrap-server localhost:9092

#Creating a topic

./kafka/bin/kafka-topics.sh --create --topic logstash_topic --bootstrap-server


localhost:9092

#Deleting a topic

./kafka/bin/kafka-topics.sh --delete --topic logstash_topic --bootstrap-server


localhost:9092

#Producing data/logs to a topic

./kafka/bin/kafka-console-producer.sh --bootstrap-server localhost:9092 --topic


logstash_topic

#Consuming logs from a topic

./kafka/bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic


logstash_topic --from-beginning

#Flink

#To start a flink cluster

./flink/bin/start-cluster.sh

#To stop a flink cluster

./flink/bin/stop-cluster.sh

#To run the flink job

./flink/bin/flink run -m localhost:8081


/mnt/c/Users/gchet/Downloads/projects/kafka-flink-demo/target/kafka-flink-demo-1.0-
SNAPSHOT.jar

#To check currently running jobs

./flink/bin/flink list -m localhost:8081


#To cancel the flink job

./flink/bin/flink cancel -m localhost:8081 <JOB_ID>

#Logstash

#To edit the configuration file of logstash

sudo nano /etc/logstash/conf.d/logstash.conf

#To edit the file which is fed into logstash

nano logstash_data/logstash_input.log

#To run logstash

/usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/logstash.conf

You might also like