Methods of payment Abuse

How to install Apache Kafka on Ubuntu 20.04

31.01.2023, 19:47
Apache Kafka is often more suitable for high-load projects than message brokers like RabbitMQ, ActiveMQ. Installing Apache Kafka on a dedicated or virtual Ubuntu Server 20.04 server is necessary for running high-load applications and ensuring bandwidth. Kafka is demanding of resources: RAM must be at least 4 GB.
 
Before rolling Apache Kafka on Ubuntu 20.04, you need to perform the initial settings:
create a user with sudo rights;
start and configure the firewall;
close root users' SSH access to the server.

How to install Apache Kafka on Ubuntu 20.04

To install Kafka, you first need to check the current versions of the packages. This is done by the command:
$ sudo apt update.
To work correctly, you need to have Java and Scala on a virtual/dedicated server. Also, a jre is required to run Kafka. The installation is carried out by the command:
$ sudo apt install default-jre
When you have completed the work, check the current version of Java:
$ java -version
Kafka works through the network, so a special account is needed for work (security, reducing the risk of compromise). Creating it with the command:
$ sudo adduser kafka
After login ($ su -l kafka), change the directory and go to tmp. The command is standard:
$ cd /tmp
To load Kafka, a classic command is used using the terminal's kurla. To download Apache Kafka, enter:
$ curl -LO https://dlcdn.apache.org/kafka/3.2.1/kafka_2.13-3.2.1.tgz
Please note that the developer periodically updates the software (version 3.4.0 is current in February 2023.
 
Create a directory into which we will unpack the distribution. The command in the terminal:
$ mkdir ~/kafka
We change the directory to go to the desired folder and unpack the archive there
$ tar -xvzf /tmp/kafka_2.13-3.2.1.tgz --strip 1.
You have installed Apache Kafka on Ubuntu 20.04. Now it remains to configure the correct operation.