centos-zookeeper-kafka

原创
08/26 18:46
阅读数 14

zookeeper

下载

# wget https://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.6.1/apache-zookeeper-3.6.1-bin.tar.gz
# tar xzvf apache-zookeeper-3.6.1-bin.tar.gz
# mv apache-zookeeper-3.6.1-bin /usr/local/zookeeper
# mkdir -p /data/zookeeper/data

配置

# cd /usr/local/zookeeper
# cp -a conf/zoo_sample.cfg conf/zoo.cfg

# vim conf/zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/data/zookeeper/data
clientPort=2181
autopurge.purgeInterval=1

# vim bin/zkServer.sh
ZOOBIN=`readlink -f "${BASH_SOURCE-$0}"`

# vim bin/zkCli.sh
ZOOBIN=`readlink -f "${BASH_SOURCE-$0}"`

# vim bin/zkEnv.sh
ZOO_LOG4J_PROP="INFO,ROLLINGFILE"

设置 myid

# echo 1 > /data/zookeeper/data/myid

软链

# ln -s /usr/local/zookeeper/bin/zkServer.sh /usr/local/bin/zk-server
# ln -s /usr/local/zookeeper/bin/zkCli.sh /usr/local/bin/zk-cli

启动服务

# zk-server start

kafka

下载

# wget https://mirror.bit.edu.cn/apache/kafka/2.6.0/kafka_2.13-2.6.0.tgz
# tar xzvf kafka_2.13-2.6.0.tgz
# mv kafka_2.13-2.6.0 /usr/local/kafka
# mkdir -p /data/kafka/logs

配置

# cd /usr/local/kafka
# vim config/server.properties
broker.id=0
listeners=PLAINTEXT://:9092
log.dirs=/data/kafka/logs
zookeeper.connect=localhost:2181

# vim bin/kafka-server-start.sh
export KAFKA_HEAP_OPTS="-Xmx256M -Xms128M"

启动服务

# cd /usr/local/kafka/bin
# ./kafka-server-start.sh -daemon ../config/server.properties
展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部