标签:tps nec lis apach ubunt bin tis gre create
一.安装zookeeper启动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
标签:tps nec lis apach ubunt bin tis gre create
原文地址:https://blog.51cto.com/rhino/2455516