3 Kafka传输部署

本文目标

部署Kafka,用来作为数据同步通道

启动kafka

tar xfz kafka_2.12-3.3.1.tgz
cd kafka_2.12-3.3.1/bin
./zookeeper-server-start.sh -daemon ../config/zookeeper.properties
./kafka-server-start.sh -daemon ../config/server.properties

创建topic

./kafka-topics.sh --list --bootstrap-server 127.0.0.1:9092
[yinyx@localhost bin]$ ./kafka-topics.sh --bootstrap-server 127.0.0.1:9092 --create --topic yinyx
Created topic yinyx.
[yinyx@localhost bin]$ ./kafka-topics.sh --list --bootstrap-server 127.0.0.1:9092
yinyx
[yinyx@localhost bin]$ ./kafka-topics.sh --bootstrap-server 127.0.0.1:9092 --describe --topic yinyx
Topic: yinyx	TopicId: 095NSZOWQ7uns2rtIt6J3A	PartitionCount: 1	ReplicationFactor: 1	Configs: 
	Topic: yinyx	Partition: 0	Leader: 0	Replicas: 0	Isr: 0
[yinyx@localhost bin]$ 

启动消费

[yinyx@localhost bin]$ ./kafka-console-consumer.sh --bootstrap-server 127.0.0.1:9092 --topic yinyx
1
你好
中国!

启动生产

[yinyx@localhost bin]$ ./kafka-console-producer.sh --bootstrap-server 127.0.0.1:9092 --topic yinyx
>1
>你好
>中国!
>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值