본문 바로가기

리눅스

[Kafka] Installing a package to use the Kafka command(kafka-topics.sh)

728x90

Installing a package to use the Kafka command(kafka-topics.sh)

Install Azul Zulu on RPM-based Linux(CentOS 7)

https://docs.azul.com/core/zulu-openjdk/install/rpm-based-linux

Install from Azul RPM repository

$ yum install -y https://cdn.azul.com/zulu/bin/zulu-repo-1.0.0-1.noarch.rpm

Install the required Azul Zulu package

$ yum install -y zulu11-jdk

Check the java version

$ /usr/lib/jvm/zulu11/bin/java --version
openjdk 11.0.13 2021-10-19 LTS
OpenJDK Runtime Environment Zulu11.52+13-CA (build 11.0.13+8-LTS)
OpenJDK 64-Bit Server VM Zulu11.52+13-CA (build 11.0.13+8-LTS, mixed mode)

Setting environmental variables(JAVA PATH)

$ vim /etc/profile
...
export JAVA_HOME=/usr/lib/jvm/zulu11
export PATH=$JAVA_HOME/bin:$PATH
$ source /etc/profile

Kafka package installation

Download Kafka URL : https://kafka.apache.org/downloads

 

Install kafka

$ wget https://archive.apache.org/dist/kafka/2.8.1/kafka_2.13-2.8.1.tgz

$ tar xvfz kafka_2.13-2.8.1.tgz

$ cd kafka_2.13-2.8.1/bin/

Kafka(kafka-topics.sh) command execution

$ ./kafka-topics.sh --create --zookeeper 192.168.0.101:2181 –replication-factor 3 --partitions 3 --topic my-topic
$ ./kafka-topics.sh --list --zookeeper 192.168.0.101:2181
my-topic

 

728x90