curl -O http://www.us.apache.org/dist/kafka/0.9.0.0/kafka_2.11-0.9.0.0.tgz
tar -xzf kafka_2.11-0.9.0.0.tgz
cd kafka_2.11-0.9.0.0php
nohup ./bin/kafka-server-start.sh config/server.properties &html
./bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic wikitickerapache
imply 默認提供了一個 demo wikiticker-kafka-supervisor.json,是一個kafka的 配置
curl -XPOST -H'Content-Type: application/json' -d @quickstart/wikiticker-kafka-supervisor.json http://localhost:8090/druid/indexer/v1/supervisorjson
返回值:{"id":"wikiticker-kafka"}api
./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic wikitickerapp
發送如下內容:
{"isRobot":false,"channel":"#en.wikipedia","timestamp":"2016-06-27T20:41:29.625Z","flags":"","isUnpatrolled":false,"page":"Indonesian future capital proposal","diffUrl":"https://en.wikipedia.org/w/index.php?diff=727266238&oldid=727256901","added":1467,"comment":"/* New capital city */ add Balikpapan and Palembang plus ref","commentLength":60,"isNew":false,"isMinor":false,"delta":1467,"isAnonymous":false,"user":"Gunkarta","deltaBucket":1400.0,"deleted":0,"namespace":"Main"}curl
參考文章:https://docs.imply.io/on-premise/tutorial-kafka-indexing-service測試
http://druid.io/docs/latest/ingestion/stream-pull.htmlui