centos6.9 普通用户安装kafka和zookeeper
Centos6.9 普通用户安装kafka和zookeeper
一、安装jdk1.8
1,创建目录
mkdir /home/XXX/usr/java
2,解压缩
cd soft
tar -zxvf jdk-8u201-linux-x64.tar.gz
3,移动
mv jdk1.8.0_201/ /home/XXX/usr/java/
目录:/home/XXX/usr/java/jdk1.8.0_201
4,配置环境变量
vim .bash_profile
export PATH=$PATH:$HOME/usr/java/jdk1.8.0_201/bin
source .bash_profile
5,验证
java -version
二、安装kafka和zookeeper
1,创建目录
mkdir /home/XXX/usr/kafka
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 &