单机安装zookeeper和kafka

一、Zookeeper
1. 下载解压
tar -zxvf apache-zookeeper-3.6.3-bin.tar.gz
1
2. 配置(非必须)
cd conf/
cp zoo_sample.cfg zoo.cfg
vi zoo.cfg

可以根据自己的需要进行配置,一般默认即可

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181

3. 启动zookeeper
启动命令:./bin/zkServer.sh

root@ACE:/usr/local/zookeeper/apache-zookeeper-3.6.3-bin# ./bin/zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/apache-zookeeper-3.6.3-bin/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

 

 

下载kafka  二进制文件

 

http://mirrors.tuna.tsinghua.edu.cn/apache/kafka/2.3.0/kafka_2.12-2.3.0.tgz
tar -xzvf kafka_2.12-2.3.0.tgz
mv kafka_2.12-2.3.0 kafka
bin/zookeeper-server-start.sh -daemon config/zookeeper.properties

 

 

参考地址: 单机zookeeper和kafka的安装和启动_郭建華的博客-CSDN博客

posted @ 2021-05-17 18:43  woaibaobei  阅读(166)  评论(0编辑  收藏  举报