Kafka单机版本地安装测试

1、下载解压

tar -xzf kafka_2.12-2.4.0.tgz

cd kafka_2.12-2.4.0

2、启动zookeeper和server

#前台启动
 bin/zookeeper-server-start.sh config/zookeeper.properties
#后台启动
nohup bin/zookeeper-server-start.sh config/zookeeper.properties >zoo.log &

> bin/kafka-server-start.sh config/server.properties

nohup bin/kafka-server-start.sh config/server.properties > server.log &

3、创建和查看topic

#新建topic
 bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test
#查看topic
bin/kafka-topics.sh --list --bootstrap-server localhost:9092

4、发送数据到topic

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

5、通过命令消费topic数据

> bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning

你可能感兴趣的:(大数据组件,消息队列,kafka,nohup,topic,消费,消息队列)