Products
GG网络技术分享 2025-11-10 14:26 2
根据您给的文章内容,
bash
systemctl stop firewalld
systemctl disable firewalld
bash
setenforce 0
bash
java -version
bash
sudo yum install java-1.8.0-openjdk
bash
wget http://mirrors.cnnic.cn/apache/kafka/2.4.0/kafka_2.12-2.4.0.tgz
wget http://mirrors.cnnic.cn/apache/zookeeper/3.5.9/zookeeper-3.5.9.tar.gz
bash
tar -zxvf kafka_2.12-2.4.0.tgz -C /opt
tar -zxvf zookeeper-3.5.9.tar.gz -C /opt
properties
# 指定日志目录
log.dirs=/opt/kafka_2.12-2.4.0/logs
# 指定broker ID
broker.id=0
# Zookeeper连接地址
zookeeper.connect=localhost:2181
properties
# 指定数据目录
dataDir=/opt/zookeeper-3.5.9/data
# 指定Zookeeper日志目录
logDir=/opt/zookeeper-3.5.9/log
/etc/hosts文件,添加如下内容:
192.168.1.100 node1
192.168.1.101 node2
192.168.1.102 node3
bash
/opt/zookeeper-3.5.9/bin/zkServer.sh start
bash
/opt/kafka_2.12-2.4.0/bin/kafka-server-start.sh /opt/kafka_2.12-2.4.0/config/server.properties
bash
jps
bash
jps
bash
/opt/zookeeper-3.5.9/bin/zkCli.sh
bash
/opt/kafka_2.12-2.4.0/bin/kafka-topics.sh --list --bootstrap-server localhost:9092
以上步骤详细介绍了怎么在Linux系统中安装和配置Kafka集群和Zookeeper呃。,比方说Zookeeper和Kafka的连接地址、日志目录等。

Demand feedback