Skip to main content
Version: 5.1

Pre-Installation Setup

Basic environment preparation must be performed on all nodes of the Kafka cluster. These steps ensure the correct installation and operation of Kafka services.

  1. Creating a System Group and User

Kafka will run under a dedicated system user. To create it, execute the following commands:

$ sudo groupadd -g 995 kafka
$ sudo useradd -u 995 -g 995 kafka
  1. Creating the Base Installation Directory
$ sudo mkdir /app
  1. Copying the Installation Archive

Copy the kafka.tar.gz archive containing the Kafka distribution to the /tmp directory.

  1. Extracting the Kafka Archive

Extract the archive contents directly into the /app directory:

$ sudo tar zxvf /tmp/kafka.tar.gz -C /app/ --strip 1
Note

The --strip 1 option is used to extract the archive contents without nested directories.

  1. Verifying the Contents of the /app Directory

After extraction, ensure the required directories have been created:

$ ls -al /app

Directory Structure After Extracting Kafka:

DirectoryPurpose
certsStorage for SSL certificates to secure communication between Kafka components.
jdkJava Runtime Environment (JDK) required for Kafka operation.
kafkaThe working directory for Kafka.
logsDirectory for storing Kafka logs.
serviceService files for managing and launching the Kafka service.
  1. Setting Permissions

Change the ownership of all created directories to the Kafka user:

$ sudo chown -R kafka:kafka /app/{certs,jdk,kafka,logs,service}