您好,登录后才能下订单哦!
一.安装zookeeper
wget https://archive.apache.org/dist/zookeeper/zookeeper-3.5.6/apache-zookeeper-3.5.6-bin.tar.gz
tar -zxvf apache-zookeeper-3.5.6-bin.tar.gz
cd apache-zookeeper-3.5.6-bin
启动zookeeper
cp zoo_sample.cfg zoo.cfg
bin/zkServer.sh start
验证
ps -ef | grep zoo
二.安装kafka
http://mirrors.tuna.tsinghua.edu.cn/apache/kafka/2.3.0/kafka_2.12-2.3.0.tgz
tar -zxvf kafka_2.12-2.3.0.tgz
cd kafka_2.12-2.3.0
cp config/zookeeper.properties config/zookeeper.properties.bak
修改config这四项
broker.id=1
listeners=PLAINTEXT://:9092
advertised.listeners=PLAINTEXT://host_ip:9092
log.dirs=/tmp/kafka/logs-1
启动kafka
bin/kafka-server-start.sh config/server.properties
验证
ps -ef | grep kafka
三.验证zookeeper 是否注册了kafka
cd apache-zookeeper-3.5.6-bin
bin/zkCli.sh
[zk: localhost:2181(CONNECTED) 0] ls /brokers/ids
如果为空,重新启动kafka
四.创建topic | 查看topic
cd kafka_2.12-2.3.0
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。