#启动kafka
/export/servers/kafka_2.11-1.0.0/bin/kafka-server-start.sh -daemon /export/servers/kafka/config/server.properties
#停止kafka
/export/servers/kafka_2.11-1.0.0/bin/kafka-server-stop.sh
#查看topic信息
/export/servers/kafka_2.11-1.0.0/bin/kafka-topics.sh --list --zookeeper node01:2181
#创建topic
/export/servers/kafka_2.11-1.0.0/bin/kafka-topics.sh --create --zookeeper node01:2181 --replication-factor 3 --partitions 3 --topic test
#查看某个topic信息
/export/servers/kafka_2.11-1.0.0/bin/kafka-topics.sh --describe --zookeeper node01:2181 --topic test
#删除topic
/export/servers/kafka_2.11-1.0.0/bin/kafka-topics.sh --zookeeper node01:2181 --delete --topic test
#启动生产者--控制台的生产者一般用于测试
/export/servers/kafka_2.11-1.0.0/bin/kafka-console-producer.sh --broker-list node01:9092 --topic spark_kafka
#启动消费者--控制台的消费者一般用于测试
/export/servers/kafka_2.11-1.0.0/bin/kafka-console-consumer.sh --zookeeper node01:2181 --topic spark_kafka--from-beginning
# 消费者连接到borker的地址
/export/servers/kafka_2.11-1.0.0/bin/kafka-console-consumer.sh --bootstrap-server node01:9092,node02:9092,node03:9092 --topic spark_kafka --from-beginning
●kafka文档
Kafka Connect:
https://kafka.apache.org/documentation/#connect
http://docs.confluent.io/2.0.0/connect/connect-jdbc/docs/index.html
Kafka Stream:
https://kafka.apache.org/documentation/streams
https://spark.apache.org/docs/1.6.1/streaming-kafka-integration.html
kafka monitor:
https://kafka.apache.org/documentation/#monitoring
https://github.com/quantifind/KafkaOffsetMonitor
https://github.com/yahoo/kafka-manager
kafka生态圈:
https://cwiki.apache.org/confluence/display/KAFKA/Ecosystem
●SparkStreaming整合Kafka
http://spark.apache.org/docs/latest/streaming-kafka-integration.html