BigDATA(47)
-
[Spark-Study] Day-3 스파크 예제를 위한 셋팅
spark 예제 돌려보기 sbt로 build를 하기 위해 필요한 것은 아래와 같다. 1. 소스 2. build.sbt sbt clean 한뒤에 sbt package를 해보자! spark-submit 해보기! /usr/local/Cellar/apache-spark/3.1.1/bin/spark-submit --class MnMcount target/scala-2.12/main-scala-chapter2_2.12-1.0.jar mnm_dataset.csv 인텔리J에 셋팅 해보기! 인텔리J에서 프로젝트를 Open 해보자! 아래와 같이 인텔리J에 프로젝트를 잘 가져왔다. 프로젝트 구조는 위와 같다. MnMcount 소스 // scalastyle:off println import org.apache.spark.sq..
2021.07.01 -
[error] SERVER ERROR: Service Unavailable url=블라블라
Error.. not found 에러! 15:54:42.639 [warn] :::::::::::::::::::::::::::::::::::::::::::::: 15:54:42.640 [warn] :: UNRESOLVED DEPENDENCIES :: 15:54:42.640 [warn] :::::::::::::::::::::::::::::::::::::::::::::: 15:54:42.640 [warn] :: net.databinder.dispatch#dispatch-core_2.12;0.11.2: not found 15:54:42.640 [warn] :: org.scalatest#scalatest_2.12;2.2.4: not found 15:54:42.640 [warn] :: org.apache.spark..
2021.06.14 -
HDFS부터 DB까지 팁 아닌 팁~
스칼라 알못 스파크 알못이라..이번에 작업한 내용이 있는데 삽질을 많이 했다...ㅋㅋ 생각나는 것들을 적어보자. HDFS를 가져와 RDD에 저장! sc.textFile을 통해서 HDFS를 가져온다. sc.textFile("hdfs path") 그런데 그냥 가져오면 소용이 없다. 그러므로 map을 통해서 필요한 친구들만 가져온다. 또한 filter를 통해 데이터를 줄여준다.ex) hdfs의 포맷이 Json이라서 Gson을 사용. filter를 통해 데이터를 줄여준다. val rddRaw0 = sc.textFile("hdfs path").map(line => new Gson().fromJson(line, classOf[TestObject])).filter(line=> line.collection.code.c..
2019.01.15 -
sbt lib 연동 안되는 현상
not found!! dependency에는 있는데 not found....sbt가 꼬인듯 하다..ㅠㅠ 이럴땐? 다시 셋팅 하자.. SBT버전이 중요! 너무 낮거나 높으면 인텔리J에서 제대로 못가져옴.-_-;; Scala/Spark 버전은 사내 분산 클러스터에 맞게 적용. build.sbt 내용 name := "neosite-data" version := "0.1" scalaVersion := "2.11.11" val sparkVersion = "1.6.2" libraryDependencies ++= Seq("org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.0", "org.scalatest" %% "scalatest" % "3.0.5" % "t..
2019.01.04 -
spark rdd programining
https://spark.apache.org/docs/latest/rdd-programming-guide.htmlspark rddOverviewAt a high level, every Spark application consists of a driver program that runs the user’s main function and executes various parallel operations on a cluster. The main abstraction Spark provides is a resilient distributed dataset (RDD), which is a collection of elements partitioned across the nodes of the cluster th..
2018.12.30 -
하둡명령어로 삭제하기(fs -rm)
하둡 hdfs 삭제 하기! #!/bin/bash # 주기적으로 hdfs 데이터를 삭제한다. # crontab 에 등록하여 실행시킨다. # 2일 전 데이터 삭제 date=`date -d "2 days ago" "+%Y%m%d"` /home/acet/program/hadoop/bin/hadoop fs -rm -r -skipTrash "/HADOOP경로/하둡path/*.txt.$date*" # 하둡 temp 데이터 삭제 find /home/acet/data/ -ctime +2 -type f -exec rm -f {} \;
2016.12.06