Kafka安装部署教程

环境准备

java 1.8

创建目录

mkdir /opt/zookeeper

mkdir /opt/kafka_client


下载安装zookeeper

wget https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.5.6/apache-zookeeper-3.5.6-bin.tar.gz

解压zookeeper

tar -zxvf apache-zookeeper-3.5.6-bin.tar.gz -C /opt/zookeeper/

移动

mv /opt/zookeeper/apache-zookeeper-3.5.6-bin/* -C /opt/zookeeper/

修改配置

cd /opt/zookeeper/conf

mv zoo_sample.cfg zoo.cfg

vim zoo.cfg

修改dataDir配置项为dataDir=/opt/zookeeper/data

启动zookeeper

cd /opt/zookeeper/bin

./zkServer.sh start

下载安装kafka

wget http://mirrors.tuna.tsinghua.edu.cn/apache/kafka/2.3.1/kafka_2.12-2.3.1.tgz

解压

tar -zxvf kafka_2.12-2.3.1.tgz -C /opt/kafka_client

移动

mv /opt/kafka_client/kafka_2.12-2.3.1/* /opt/kafka_client

启动kafka

cd /opt/kafka_client/bin./kafka-server-start.sh -daemon config/server.properties

你可能感兴趣的:(Kafka安装部署教程)