Kafuka相關文章集合 Kafka-PHP擴展的使用

Kafka 2.0 安裝以及使用:html

http://www.tianshouzhi.com/api/tutorials/kafka/117python

kafka實戰:react

https://www.cnblogs.com/hei12138/p/7805475.htmlapi

 

Kafka-PHP擴展的使用

使用python鏈接kafka

 

 

1. 主要功能

根據官網的介紹,ApacheKafka®是一個分佈式流媒體平臺,它主要有3種功能:app

  1:It lets you publish and subscribe to streams of records.發佈和訂閱消息流,這個功能相似於消息隊列,這也是kafka歸類爲消息隊列框架的緣由框架

  2:It lets you store streams of records in a fault-tolerant way.以容錯的方式記錄消息流,kafka以文件的方式來存儲消息流分佈式

  3:It lets you process streams of records as they occur.能夠再消息發佈的時候進行處理post

2.使用場景

1:Building real-time streaming data pipelines that reliably get data between systems or applications.在系統或應用程序之間構建可靠的用於傳輸實時數據的管道,消息隊列功能ui

2:Building real-time streaming applications that transform or react to the streams of data。構建實時的流數據處理程序來變換或處理數據流,數據處理功能url

 

3.行默認的Kafka

啓動Zookeeper server

[root@localhost kafka_2.9.1-0.8.2.2]# sh bin/zookeeper-server-start.sh config/zookeeper.properties &

啓動Kafka server

[root@localhost kafka_2.9.1-0.8.2.2]# sh bin/kafka-server-start.sh config/server.properties &

運行生產者producer

[root@localhost kafka_2.9.1-0.8.2.2]# sh bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test

運行消費者consumer

[root@localhost kafka_2.9.1-0.8.2.2]# sh bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
相關文章
相關標籤/搜索