This is the first day of my participation in the Gwen Challenge in November. Check out the details: the last Gwen Challenge in 2021

Apache Kafka profile

Kafka is a distributed, partitioned, multi-copy, multi-subscriber, zooKeeper coordinated distributed logging system (also known as MQ system). Kafka is commonly used for Web/Nginx logging, access logging, messaging, and more. Linkedin was donated to the Apache Foundation in 2010 and became a top open source project.

Install standalone Kafka in Linux

2.1 Checking whether the Jdk is installed

Java -version command, my Linux environment already installed JDK, skip to the next step

2.2 Checking whether zK is installed

Because Kafka relies on ZooKeeper to run, check that ZooKeeper is not already installed. Go directly to the official website to download, and then upload to the server.

Zk’s official website: downloads.apache.org/zookeeper/s… Select Binary Downloads and select the version to download

  1. Unpack the

[root@VM_0_14_centos local]# tar -xzvf apache-zookeeper-3.6.3-bin.tar.gz

  1. The configuration file
## 1. Copy the configuration file
[root@VM_0_14_centos ~]# cd /usr/local/
[root@VM_0_14_centos local]# tar - XZVF apache - they are - 3.6.3 - bin. Tar. Gz
[root@VM_0_14_centos local]# cd apache-zookeeper/
[root@VM_0_14_centos apache-zookeeper]# cd conf/
[root@VM_0_14_centos conf]# cp zoo_sample.cfg zoo.cfg
[root@VM_0_14_centos conf]# vi zoo.cfg

## 2. Zoo. CFG added at the end of the file
dataDir=/tmp/zookeeper/data
dataLogDir=/tmp/zookeeper/log

## 3. Create a directory in TMP
[root@VM_0_14_centos conf]# mkdir /tmp/zookeeper
[root@VM_0_14_centos conf]# mkdir /tmp/zookeeper/data
[root@VM_0_14_centos conf]# mkdir /tmp/zookeeper/log

## 4. Configure environment variables
[root@VM_0_14_centos conf]# export ZK_PATH=/usr/local/apache-zookeeper/
[root@VM_0_14_centos conf]# export PATH=$PATH:$ZK_PATH/bin

## 5. Start ZK
[root@VM_0_14_centos bin]# ./zkServer.sh start
/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /usr/local/ apache - they are - 3.6.3 / bin /.. /conf/zoo.cfg Starting zookeeper ... STARTED## 6. Verify ZK

Copy the code

2.3 Installing Single-node Kafaka

Into the Apache’s official website http://kafka.apache.org/downloads.html

Select Binary Downloads and select the version to download. Generally, it is recommended to install the version before 1.1, which causes few problems.

Reference documentation

kafka.apache.org/quickstart