Kafka(一):Kafka介绍和安装

 

[root@coco kafka_2.13-3.3.1]# bin/zookeeper-server-start.sh -daemon config/zookeeper.properties

#zkServer.sh status 查看服务状态

#zkServer.sh start

#zkServer.sh stop

#zkServer.sh restart

[root@coco bin]# pwd
/root/apache-zookeeper-3.8.0-bin/bin
[root@coco bin]# ./zkServer.sh status
/usr/bin/java
ZooKeeper JMX enabled by default
Using config: /root/apache-zookeeper-3.8.0-bin/bin/../conf/zoo.cfg
Client port found: 2181. Client address: localhost. Client SSL: false.
Mode: standalone

 

[root@coco kafka_2.13-3.3.1]# ./bin/kafka-server-start.sh ./config/server.properties

 

[root@coco kafka_2.13-3.3.1]# bin/kafka-topics.sh –create –topic test-topic –bootstrap-server localhost:9092
Created topic test-topic.

[root@coco kafka_2.13-3.3.1]# bin/kafka-topics.sh –describe –topic test-topic –bootstrap-server localhost:9092
Topic: test-topic TopicId: 0kmY1UHrRtms8ovgmxeTvQ PartitionCount: 1 ReplicationFactor: 1 Configs:
Topic: test-topic Partition: 0 Leader: 0 Replicas: 0 Isr: 0

 

[root@coco kafka_2.13-3.3.1]# bin/kafka-console-producer.sh –topic test-topic –bootstrap-server localhost:9092
>a
>b
>c
>hello world
>test
>

 

[root@coco kafka_2.13-3.3.1]# bin/kafka-console-consumer.sh –topic test-topic –from-beginning –bootstrap-server localhost:9092
a
b
c
hello world
test

 

 

 

 

给TA打赏
共{{data.count}}人
人已打赏
素材

美女剪影

2022-1-22 21:24:56

面试

面试官:Redis新版本开始引入多线程,谈谈你的看法?

2022-1-22 17:47:49

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索