kafka 消息中間件

1. 啓動kafka

```
   nohup ./bin/kafka-server-start.sh ./config/server.properties >> /opt/enclogs/kafka.log 2>&1 &
```

   ![image-20190925101435351](assets/image-20190925101435351.png)

   

創建Topic

```
kafka_2.11-1.1.1]# bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --replication-factor 1 --partitions 1 --topic gateway.invokeLog

bin/kafka-topics.sh --create --zookeeper 127.0.0.1:2181 --replication-factor 1 --partitions 1 --topic view.datadistribute
```

測試數據消費情況

```
kafka_2.11-1.1.1]# bin/kafka-console-producer.sh --broker-list xx.xx:9092 --topic gateway.invokeLog
kafka_2.11-1.1.1]# bin/kafka-console-consumer.sh --zookeeper 127.0.0.1:2181 --topic test --from-beginning

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章