码迷,mamicode.com
首页 > 其他好文 > 详细

[Spark]Spark-streaming通过Receiver方式实时消费Kafka流程(Yarn-cluster)

时间:2018-12-01 11:08:19      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:top   ica   with   任务   dep   sem   cat   流程   博客   

1.启动zookeeper
2.启动kafka服务(broker)
[root@master kafka_2.11-0.10.2.1]# ./bin/kafka-server-start.sh config/server.properties
3.启动kafka的producer(前提:已经创建好topic
[root@master kafka_2.11-0.10.2.1]# ./bin/kafka-console-producer.sh --broker-list master:9092 --topic test
4.启动kafka的consumer
[root@master kafka_2.11-0.10.2.1]#./bin/kafka-console-consumer.sh --zookeeper master:2181 --topic test --from-beginning
5.打jar包,将带有依赖的jar包上传到集群上
mvn clean assembly:assembly
6.编写启动脚本,启动任务 sh run_receiver.sh
/usr/local/src/spark-2.0.2-bin-hadoop2.6/bin/spark-submit        --class com.skyell.streaming.ReceiverFromKafka        --master yarn-cluster         --executor-memory 1G         --total-executor-cores 2         --files $HIVE_HOME/conf/hive-site.xml         ./Spark8Pro-2.0-SNAPSHOT-jar-with-dependencies.jar
监控任务及查看日志

http://master:8088/cluster

关闭spark streaming任务
yarn application -kill application_1539421032843_0093

数据驱动变革-云将 个人博客地址

[Spark]Spark-streaming通过Receiver方式实时消费Kafka流程(Yarn-cluster)

标签:top   ica   with   任务   dep   sem   cat   流程   博客   

原文地址:https://www.cnblogs.com/skyell/p/10048189.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!