메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.


import org.apache.spark.SparkContext
import org.apache.spark.streaming.StreamingContext
import org.apache.spark.streaming.Seconds

object StreamingLogsMB {
  def main(args: Array[String]) {
    if (args.length < 2) {

      System.err.println("Usage: stubs.StreamingLogsMB <hostname> <port>")
      System.exit(1)
    }

    // get hostname and port of data source from application arguments
    val hostname = args(0)
    val port = args(1).toInt

    // Create a Spark Context
    val sc = new SparkContext()

    // Set log level to ERROR to avoid distracting extra output
    sc.setLogLevel("ERROR")

    // Configure the Streaming Context with a 1 second batch duration
    val ssc = new StreamingContext(sc,Seconds(1))

    // Create a DStream of log data from the server and port specified
    val logs = ssc.socketTextStream(hostname,port)

    ssc.checkpoint("logcheckpt")

    logs.countByWindow(Seconds(5), Seconds(2)).print

    ssc.start()
    ssc.awaitTermination()
  }
}

번호 제목 날짜 조회 수
630 windows7에서 lagom의 hello world를 빌드하여 실행하는 경우의 로그(mvn lagom:runAll -Dscala.binary.version=2.11) 2017.12.22 2996
629 hadoop에서 yarn jar ..를 이용하여 appliction을 실행하여 정상적으로 수행되었으나 yarn UI의 어플리케이션 목록에 나타나지 않는 문제 2017.05.02 2998
628 centos 6에서 mariadb 5.1 to 10.0 으로 upgrade 2016.11.01 3003
627 hadoop에서 yarn jar ..를 이용하여 appliction을 실행하여 정상적(?)으로 수행되었으나 yarn UI의 어플리케이션 목록에 나타나지 않는 문제 2017.05.02 3005
626 숭실대 교수님등 강의영상(바이오데이터마이닝, 빅데이터분산컴퓨팅, 컴퓨터 그래픽스, 데이터베이스응용및 프로그램밍, 데이터베이스, 의생명영상처리, 웹그로그래밍, 데이터마이닝, 컴퓨터구조) file 2017.06.13 3011
625 RDF storage조합에대한 test결과(4store, Jena+HBase, Hive+HBase, CumulusRDF, Couchbase) 페이지 링크 2016.05.26 3018
624 spark-shell을 실행하면 "Attempted to request executors before the AM has registered!"라는 오류가 발생하면 2018.06.08 3024
623 sparql에서 concat에제 2015.11.27 3029
622 hadoop에서 yarn jar ..를 이용하여 appliction을 실행하여 정상적으로 수행되었으나 yarn UI의 어플리케이션 목록에 나타나지 않는 문제 2017.05.02 3037
621 Cloudera설치중에 "Error, CM server guid updated"오류 발생시 조치방법 2018.03.29 3044
620 Authorization within Hadoop Projects 2022.06.13 3047
619 elasticsearch 기동시 permission denied on key 'vm.max_map_count' 오류발생시 조치사항 2017.06.23 3056
618 모두를 위한 머신러닝과 딥러닝의 강의 file 2016.09.27 3061
617 Spark Streaming 코드레벨단에서의 성능개선 2016.10.31 3069
616 fuseki용 config-examples.ttl 예시 내용 2017.05.17 3069
615 [Encryption Zone]Encryption Zone에 생성된 table을 select할때 HDFS /tmp/zone1에 대한 권한이 없는 경우 2023.06.29 3070
614 magento2 샘플데이타 설치 2017.01.31 3071
613 바나나 파이의 /tmp폴더를 외장하드로 변경하기 2015.07.24 3075
612 대표 오픈소스 라이선스, 한 눈에 보기! 2015.12.10 3079
611 format된 namenode를 다른 서버에서 다시 format했을때 오류내용 2016.09.22 3086
위로