IDEA中运行DirectKafkaWordCount程序
来源:互联网 发布:软件标识 编辑:程序博客网 时间:2024/06/04 22:14
1,将SPARK_HOME中的DirectKafkaWordCount程序复制到idea中.
2,由于在KafkaWordCount中已引入相关jar包,此步可略过
3,配置configurations参数
关于program arguments参数,程序中定义如下:
/**
* Consumes messages from one or more topics in Kafka and does wordcount.
* Usage: DirectKafkaWordCount <brokers> <topics>
* <brokers> is a list of one or more Kafka brokers
* <topics> is a list of one or more kafka topics to consume from
*
* Example:
* $ bin/run-example streaming.DirectKafkaWordCount broker1-host:port,broker2-host:port \
* topic1,topic2
*/
第一个参数为一系列的brokers,可以设置多个;第二个参数为一系列topic,也可以设置为多个.
本次运行时只采用localhost:9092和test
4,将之前的KafkaWordCountProducer运行起来,运行DirectKafkaWordCount可以看到如下结果:
也可不运行KafkaWordCountProducer,而是另外起一个console服务,在窗口中运行kafka-console-producer.sh --broker-list localhost:9092 --sync --topic test
0 0
- IDEA中运行DirectKafkaWordCount程序
- IDEA中运行KafkaWordCount程序
- 使用IDEA运行Spark程序
- idea本地运行hdfs程序
- idea本地运行mapreduce程序
- IntelliJ IDEA 14 如何运行maven程序
- intelliji idea 基于maven运行spark程序
- IntelliJ Idea开发spark程序及运行
- 在idea上运行hadoop程序
- 使用idea sbt运行spark程序
- IntelliJ IDEA 14 如何运行maven程序
- 安装IDEA和运行SCALA程序
- 在IDEA中调试运行Spark SQL
- 关于在idea中运行tomcat。
- IDEA 编译运行过程中简单错误
- IDEA中运行.dll(JNI)
- 2017-3-4 IDEA中运行Topology
- 删除运行中程序
- 使用集合LinkedList模拟堆栈方法
- word格式转换成pdf格式转换器
- Python之数据类型 二
- 查看局域网内在线ip
- java调用TD的COM组件OTAClient80.dll实现从TD中取数
- IDEA中运行DirectKafkaWordCount程序
- Java之路
- weblogic jvm -Dsun.zip.disableMemoryMapping=true
- Swift 闭包
- [sicily]1035. DNA matching
- 分析比较KafkaWordCount及DierctKafkaWordCount
- 单立模式 Java
- 计算机网络之网络安全
- python 字符串和编码