spark部署一台机器时sparkstreaming无结果数据打印的问题
2015-06-02 15:27
405 查看
如:
此时默认 --master 为 local .
这看起来毫无问题,但我在一台1核1G的主机上测试该样例,却永远无法成功。 原因这位老兄已道出:
Note
I experienced exactly the same problems when using SparkContext with “local[1]” master specification, because in that case one thread is used for receiving data, the others for processing. As there is only one thread running, no processing will take place.
Once you shut down the connection, the receiver thread will be used for processing.
也就是说,spark streaming在启动时会启动两个线程: receving thread和 processing data thread.
local 模式下,spark streaming只启动了与CPU核数相同个数的线程(在我的例子中, 只有一个线程),无论如何是无法测试成功的;而在其它开发主机(4核主机)则完全不会出现此问题。
这涉及到了spark的线程模型。更深入的文档我还尚未找到。如果你有更深入的理解,欢迎探讨。
bin/run-example org.apache.spark.examples.streaming.NetworkWordCount localhost 9999
此时默认 --master 为 local .
这看起来毫无问题,但我在一台1核1G的主机上测试该样例,却永远无法成功。 原因这位老兄已道出:
Note
I experienced exactly the same problems when using SparkContext with “local[1]” master specification, because in that case one thread is used for receiving data, the others for processing. As there is only one thread running, no processing will take place.
Once you shut down the connection, the receiver thread will be used for processing.
也就是说,spark streaming在启动时会启动两个线程: receving thread和 processing data thread.
local 模式下,spark streaming只启动了与CPU核数相同个数的线程(在我的例子中, 只有一个线程),无论如何是无法测试成功的;而在其它开发主机(4核主机)则完全不会出现此问题。
这涉及到了spark的线程模型。更深入的文档我还尚未找到。如果你有更深入的理解,欢迎探讨。
相关文章推荐
- sublime text3 3083 注册码
- linux重启防火墙
- Guardian of Decency - UVa 12083 二分图最大独立点集
- socket实现客户端与服务端通信(一)服务端
- 进程标志位(ProcessFlag_ProcessState)
- Wait A Moment, JavaScript Does Support Multiple Inheritance!
- LeetCode Contains Duplicate II Contains Duplicate III
- MongoDB学习笔记~自己封装的Curd操作(按需更新的先决条件)
- Visual Studio 调试技巧
- Linux Shell脚本系列教程(七):脚本调试
- CSDN越做越恶心
- c#窗体传值用法实例详解
- Spark 批量写数据入HBase
- ThinkPHP开发笔记-前后端数据交互
- 安卓笔记-selector选择器
- binlog作用
- 探究String、StringBuffer、StringBuilder的区别?
- 这是SEO优化的系统工作,但绝对不是全部工作
- 导航条菜单
- Visual Studio 调试技巧