Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy kafka clusters in linux

2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to deploy kafka clusters in linux. I think it is very practical, so I share it with you. I hope you can get something after reading this article. Let's take a look at it.

1. Download from the official website and decompress and install it on each machine.

# create the kafka installation directory mkdir-p / usr/local/software/kafka# and extract tar-xvf kafka_2.12-1.1.0.tgz-C / usr/local/software/kafka/

2. Modify the / etc/profile file of each server, set the kafka environment variable, and add the following

Export KAFKA_HOME=/usr/local/software/kafka/kafka_2.12-1.1.0export PATH=$PATH:$KAFKA_HOME/bin

Restart the configuration after adding, and the command is as follows:

Source / etc/profile

3. Modify the server.properties file under $KAFKA_HOME/config of each server, modify the agent id and log storage directory

# the specified agent id,borker.id can be specified arbitrarily, as long as the broker.id of each machine in the cluster is unique, and the second machine is set to 2. And so on, broker.id=1# sets the log directory, log.dirs=/opt/data/kafka/kafka-logs# sets the zookeeper cluster address, zookeeper.connect=192.168.174.7:2181192.168.174.8:2181192.168.174.9:2181# sets the local address, to the ip address of the server. If not, a NOT LEADER FOR PARTITION exception occurs when a topic is created and a message is sent. Host.name=192.168.174.10

4. After the configuration is completed, start the kafka of each of the three servers, and make sure that the zookeeper cluster has been started successfully before starting kafka.

Kafka-server-start.sh-daemon server.properties

5. Verify whether the startup is successful.

Jps

If you see the kafka process, you started successfully.

You can also view the zookeeper directory structure through the zookeeper client, as follows:

# Log in to zookeeperzkCli. Sh-server 192.168.174.7 ls 218 check the directory structure ls / # View the launched kafka agent ls / brokers/ids what is the Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-tasking, multi-threading and multi-CPU operating system, using Linux to run major Unix tools, applications and network protocols.

The above is how to deploy kafka clusters in linux. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report