centos6.9 普通用戶安裝kafka和zookeeper

Centos6.9 普通用戶安裝kafka和zookeeper

1、安裝jdk1.8

1,建立目錄

mkdir /home/XXX/usr/javajava

2,解壓縮

cd softlinux

tar -zxvf jdk-8u201-linux-x64.tar.gzvim

3,移動

mv jdk1.8.0_201/ /home/XXX/usr/java/bash

目錄:/home/XXX/usr/java/jdk1.8.0_201日誌

4,配置環境變量

vim .bash_profileserver

export PATH=$PATH:$HOME/usr/java/jdk1.8.0_201/binkafka

source .bash_profileio

5,驗證

java -version變量

 

2、安裝kafka和zookeeper

1,建立目錄

mkdir /home/XXX/usr/kafkazookeeper

mkdir /home/XXX/usr/local/kafka-logs

mkdir /home/XXX/usr/zookeeper

2,解壓縮

cd soft

tar -zxvf kafka_2.12-2.2.0.tgz

mv kafka_2.12-2.2.0 /home/XXX/usr/kafka/

cd /home/XXX/usr/kafka/bin

+++++++++++++++++++++++++

cd soft

tar -zxvf zookeeper-3.4.14.tar.gz

mv zookeeper-3.4.14 /home/XXX/usr/zookeeper/

3,修改zookeeper文件

cd /home/XXX/usr/zookeeper/zookeeper-3.4.14/conf

mv zoo_sample.cfg zoo.cfg

4,啓動zookeeper

cd /home/XXX/usr/zookeeper/zookeeper-3.4.14/bin && sh zkServer.sh start

5,修改kafka配置文件

vi /home/homeward/usr/kafka/kafka_2.12-2.2.0/config/server.properties

broker.id=1 //節點數

log.dir=/home/XXX/usr/local/kafka-logs //存放日誌路徑

6,啓動kafka

cd /home/XXX/usr/kafka/kafka_2.12-2.2.0/bin && nohup ./kafka-server-start.sh ../config/server.properties &

相關文章
相關標籤/搜索