2017-04-05 2 views
-1

apche spark (스트리밍)에서 maven으로 작업하고 있습니다. 그리고 스칼라 프로그래밍. 나는 코드가 올바른 지시를 끈 경우apache spark 스트리밍 오류

val sc= new StreamingContext(conf , Seconds(1)) 

: 는 사실, 나는 다음과 같은 명령과 함께 작은 문제가 있습니다.

이 내 전체 코드 (네트워크 단어 개수)입니다 :

import org.apache.spark.SparkConf 
import org.apache.spark.streaming.{Seconds, StreamingContext} 
import org.apache.spark.storage.StorageLevel 

object WordCountStreaming { 
    def main(args: Array[String]): Unit = { 
    val conf = new SparkConf() .setMaster("local") 
      .setAppName("WordCountStreaming") 
      .set("spark.driver.allowMultipleContexts","true"); val sc= new 
    StreamingContext(conf , Seconds(1)) val lines = 
     sc.socketTextStream(args(0), args(1).toInt, 
    StorageLevel.MEMORY_AND_DISK_SER) sc.start() sc.awaitTermination() 
    } 
} 
+0

오류 로그 및 코드 – Kartoch

+0

수입 org.apache.spark.SparkConf 수입 org.apache.spark.streaming를 추가하십시오. {초, StreamingContext} 수입 org.apache.spark.storage.StorageLevel 객체 WordCountStreaming {데프 main (args : Array [String]) : unit = { val conf = new SparkConf() .setMaster ("local") .setAppName ("WordCountStreaming") .set ("spark.driver.allowMultipleContexts", " 참된"); (0), args (1) .toInt, StorageLevel.MEMORY_AND_DISK_SER) sc.start()sc.ocketText } } –

+0

귀하는 질문에 추가 할 수 있음을 알고 있습니다. – Kartoch

답변

0
다음

당신이 "지역 [*]"또는 "지역 [2]"마스터에서 스파크가 스트리밍 때문에 캔트 작품을 제공하기 위해 시도하십시오 수 있습니다 단일 스레드이므로 로컬에서 실행하는 경우 하나 이상의 스레드가있는 마스터에서 시도하십시오.

+0

컴파일 할 때 오류가 발생한다. 나는 위의 지시를 남겨두면 그것을 바로 잡으려고했습니다. 오류가 사라집니다 val sc = new StreamingContext (conf, Seconds (1)) –

+0

오류 로그를 알려주십시오. –

+0

코드 사용법을 확인하십시오! 우리는 어떻게 대답 할 수 있습니까? – Kartoch