解决spark-shell执行官方sparkstreaming 报 only one sparkcontext maybe running in this jvm的错误
来源:互联网 发布:倩女幽魂手游 mac登陆 编辑:程序博客网 时间:2024/05/17 22:38
解决:
不执行蓝字,更改红字为
val ssc = new StreamingContext(sc, Seconds(1))
=====================================================================
import org.apache.spark._
import org.apache.spark.streaming._import org.apache.spark.streaming.StreamingContext._ // not necessary since Spark 1.3
// Create a local StreamingContext with two working thread and batch interval of 1 second.
// The master requires 2 cores to prevent from a starvation scenario.
val conf = new SparkConf().setMaster("local[2]").setAppName("NetworkWordCount")
val ssc = new StreamingContext(conf, Seconds(1))
======================================================================
红字之后报了only one sparkcontext maybe running in this jvm 的错误,是因为spark-shell已经生成了一个 sparkcontext 为sc的原因。
直接使用即可,无须重新生成sc。
0 0
- 解决spark-shell执行官方sparkstreaming 报 only one sparkcontext maybe running in this jvm的错误
- Spark Q&A : Only one SparkContext may be running in this JVM
- Only one SparkContext may be running in this JVM
- profiler 报attach to a running instance of this jvm is not supported错误
- Monads in Scala Part One: Maybe[Person]
- 忽然遇到报错:ERROR spark.SparkContext: Error initializing SparkContext.
- Spark学习之4:SparkContext执行过程
- Only one JmsListenerAnnotationBeanPostProcessor may exist within the context错误解决
- scala中spark错误 Error initializing SparkContext
- 奇怪的错误:This generally means that another instance of this process was already running or is hung in t
- The system is running in low-graphics mode报错的解决
- linux执行SHELL脚本报错“syntax error near unexpected token `in”解决
- linux执行SHELL脚本报错“syntax error near unexpected token `in”解决
- linux执行SHELL脚本报错“syntax error near unexpected token `in”解决
- 执行SQL语句报ORA-00600 错误的解决
- 执行SQL语句报ORA-00600 错误的解决
- 解决android执行adb shell的错误问题
- 【Android】关于执行adb shell的错误解决
- Cursor源码梳理
- Linux设置静态IP
- 如何安装 sass
- Intel Code Challenge Elimination Round (Div.1 + Div.2, combined)E. Research Rover (容斥Lucas)
- Timer和TimerTask详解
- 解决spark-shell执行官方sparkstreaming 报 only one sparkcontext maybe running in this jvm的错误
- I/O复用之epoll简介
- CircleView轻量级显示圆形,支持更多属性
- 【转载】互联网高级测试工程师至少具备的能力
- Access restriction:The type JPEGCodec is not accessible due to restriction on re
- coding interview guide-仅用递归函数和栈操作逆序一个栈-c++实现
- 提交应用到iTunes Connect时构建版本“正在处理”后直接消失
- 解决:pydev 在 eclipse 中安装后不显示
- Hessian-Affine extractor and the SIFT descriptor