部署Kafka,用來(lái)作為數(shù)據(jù)同步通道
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
創(chuàng)建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]$
啟動(dòng)消費(fèi)[yinyx@localhost bin]$ ./kafka-console-consumer.sh --bootstrap-server 127.0.0.1:9092 --topic yinyx
1
你好
中國(guó)!
啟動(dòng)生產(chǎn)[yinyx@localhost bin]$ ./kafka-console-producer.sh --bootstrap-server 127.0.0.1:9092 --topic yinyx
>1
>你好
>中國(guó)!
>
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購(gòu),新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧