mirror of
https://github.com/silicoflare/docker-hadoop.git
synced 2026-05-26 20:17:59 +05:30
feat: add kafka cli
This commit is contained in:
@@ -148,12 +148,15 @@ RUN wget https://jdbc.postgresql.org/download/postgresql-42.7.1.jar && \
|
|||||||
COPY restart $HADOOP_HOME/bin/restart
|
COPY restart $HADOOP_HOME/bin/restart
|
||||||
COPY init $HADOOP_HOME/bin/init
|
COPY init $HADOOP_HOME/bin/init
|
||||||
COPY colors $HADOOP_HOME/bin/colors
|
COPY colors $HADOOP_HOME/bin/colors
|
||||||
|
COPY kafka $HADOOP_HOME/bin/kafka
|
||||||
RUN dos2unix $HADOOP_HOME/bin/restart && \
|
RUN dos2unix $HADOOP_HOME/bin/restart && \
|
||||||
dos2unix $HADOOP_HOME/bin/colors && \
|
dos2unix $HADOOP_HOME/bin/colors && \
|
||||||
dos2unix $HADOOP_HOME/bin/init && \
|
dos2unix $HADOOP_HOME/bin/init && \
|
||||||
|
dos2unix $HADOOP_HOME/bin/kafka && \
|
||||||
chmod +x $HADOOP_HOME/bin/restart && \
|
chmod +x $HADOOP_HOME/bin/restart && \
|
||||||
chmod +x $HADOOP_HOME/bin/colors && \
|
chmod +x $HADOOP_HOME/bin/colors && \
|
||||||
chmod +x $HADOOP_HOME/bin/init
|
chmod +x $HADOOP_HOME/bin/init && \
|
||||||
|
chmod +x $HADOOP_HOME/bin/kafka
|
||||||
|
|
||||||
# Cleaning up archives
|
# Cleaning up archives
|
||||||
RUN rm *.tar.gz && \
|
RUN rm *.tar.gz && \
|
||||||
|
|||||||
20
kafka
Normal file
20
kafka
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
verb=$1
|
||||||
|
arg=$2
|
||||||
|
|
||||||
|
if [ $verb == "start" ]; then
|
||||||
|
if [ $arg == "zookeeper" ]; then
|
||||||
|
$KAFKA_HOME/bin/zookeeper-server-start.sh $KAFKA_HOME/config/zookeeper.properties
|
||||||
|
elif [ $arg == "kafka" ]; then
|
||||||
|
$KAFKA_HOME/bin/kafka-server-start.sh $KAFKA_HOME/config/server.properties
|
||||||
|
fi
|
||||||
|
elif [ $verb == "create-topic" ]; then
|
||||||
|
$KAFKA_HOME/bin/kafka-topics.sh --create --topic $arg --bootstrap-server localhost:9092
|
||||||
|
elif [ $verb == "produce" ]; then
|
||||||
|
$KAFKA_HOME/bin/kafka-console-producer.sh --topic $arg --bootstrap-server localhost:9092
|
||||||
|
elif [ $verb == "consume" ]; then
|
||||||
|
$KAFKA_HOME/bin/kafka-console-consumer.sh --topic $arg --from-beginning --bootstrap-server localhost:9092
|
||||||
|
elif [ $verb == "submit" ]; then
|
||||||
|
spark-submit --packages org.apache.spark:spark-sql-kafka-0-10_2.12:3.0.1 $arg
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user