메뉴 건너뛰기

Cloudera, BigData, Semantic IoT, Hadoop, NoSQL

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


sbt centos에 sbt 0.13.5 설치

총관리자 2016.05.30 15:21 조회 수 : 369

1. 다운로드

wget http://dl.bintray.com/sbt/rpm/sbt-0.13.5.rpm


2. 설치

yum localinstall sbt-0.13.5.rpm


3. sbt실행

sbt

==>  

Getting org.scala-sbt sbt 0.13.5 ... 


설치후 처음 실행할때 "Getting org.scala-sbt sbt 0.13.5 ..."가 표시되면서 멈춘것처럼 보이는데.. default jar파일들을 다운로드 받는 동안 시간이 걸리게 되는데 15분이내에 끝나므로 완료될때 까지 기다리면 된다.


4. building하고 *.jar실행(실행하는 곳에 project.sbt가 있어야함)

3.에서 실행한 sbt에서 package를 입력한다.


5. Simple Build Tool.


Coursera의 교육과정 중에서 [[마틴 오더스키]]가 진행하는 [[Functional Programming Principles in Scala]]와 [[Principles of Reactive Programming]]은 [[스칼라]] 언어로 프로그래밍 과제가 제시된다. 이때 사용하는 빌드 도구가 [sbt(Simple Build Tool)](http://www.scala-sbt.org/)이다.


프로젝트 폴더에서 `sbt` 명령으로 **sbt프롬프트**에 진입하고 나면 sbt명령으로 대상을 빌드하거나 테스트할 수 있다. 앞의 두 교육과정에서는 과제를 제출하는 것도 sbt에서 가능하다.


    <project dir>

    +-- build.sbt

    +-- project/

    |   +-- build.properties

    |   +-- ProgFunBuild.scala  ; submit 태스크정의

    |   ..

    +-- target/

    |   +-- scala-2.10          ; 빌드 결과물이 여기에 들어간다.


## 설치


맥에서는 brew를 이용하여 쉽게 설치할 수 있다. `brew install sbt`로 설치하면 `sbt console`로 스칼라를 사용할 수도 있는데, 스칼라를 따로 설치하지 않으면 콘솔에서 직접 `scala` 명령을 사용할 수 없다는 점이 특이하다.


리눅스/맥에서 수동으로 설치하는 것도 매우 간단한다. 부트스트랩 격인 sbt-launcher.jar를 받고, 이를 호출하는 sbt.sh 스크립트를 만들어주면 된다. launcher jar파일이 작아서 한번 놀라고, 처음 실행했을 때 엄청나게 다운로드를 많이 하는데서 또 한 번 놀라게 된다.



## 주요명령


* compile

* test

* package

* clean

* reload

* update

* settings

* inspect - 빌드 설정 값을 자세히 살펴보기 위해 사용한다. `sbt inspect sourceManaged`


## 플러그인 


[다양한 플러그인](http://www.scala-sbt.org/release/docs/Community/Community-Plugins.html)이 있어서 빌드에 필요한 명령들을 가져다 쓸 수 있다. 


* *assembly* - https://github.com/sbt/sbt-assembly `sbt assembly`로 의존성을 전부 머지한 jar파일을 생성해준다.

* *eclipse* - https://github.com/typesafehub/sbteclipse `sbt eclipse`로 현재 의존성을 반영하여 이클립스 프로젝트 정보를 생성한다.

* *git* - https://github.com/sbt/sbt-git sbt프롬프트에서 git명령을 바로 사용할 수 있게 해준다.

* *antlr4* - https://github.com/ihji/sbt-antlr4 [[ANTLR]]를 사용할 수 있게 해준다. 






--------------초기 실행시 console로그중 일부분--------

Getting org.scala-sbt sbt 0.13.5 ...

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.5/jars/sbt.jar ...

        [SUCCESSFUL ] org.scala-sbt#sbt;0.13.5!sbt.jar (3989ms)

downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar ...

        [SUCCESSFUL ] org.scala-lang#scala-library;2.10.4!scala-library.jar (108767ms)

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.5/jars/main.jar ...

        [SUCCESSFUL ] org.scala-sbt#main;0.13.5!main.jar (6702ms)

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.5/jars/compiler-interface-src.jar ...

        [SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.5!compiler-interface-src.jar (3713ms)

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/0.13.5/jars/compiler-interface-bin.jar ...

        [SUCCESSFUL ] org.scala-sbt#compiler-interface;0.13.5!compiler-interface-bin.jar (4428ms)

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_8_2/0.13.5/jars/compiler-interface-bin.jar ...

        [SUCCESSFUL ] org.scala-sbt#precompiled-2_8_2;0.13.5!compiler-interface-bin.jar (4452ms)

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_9_2/0.13.5/jars/compiler-interface-bin.jar ...

        [SUCCESSFUL ] org.scala-sbt#precompiled-2_9_2;0.13.5!compiler-interface-bin.jar (4663ms)

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/precompiled-2_9_3/0.13.5/jars/compiler-interface-bin.jar ...

        [SUCCESSFUL ] org.scala-sbt#precompiled-2_9_3;0.13.5!compiler-interface-bin.jar (4585ms)

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/actions/0.13.5/jars/actions.jar ...

        [SUCCESSFUL ] org.scala-sbt#actions;0.13.5!actions.jar (4955ms)

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main-settings/0.13.5/jars/main-settings.jar ...

        [SUCCESSFUL ] org.scala-sbt#main-settings;0.13.5!main-settings.jar (4305ms)

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/interface/0.13.5/jars/interface.jar ...

        [SUCCESSFUL ] org.scala-sbt#interface;0.13.5!interface.jar (4104ms)

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/io/0.13.5/jars/io.jar ...

        [SUCCESSFUL ] org.scala-sbt#io;0.13.5!io.jar (4655ms)

downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/ivy/0.13.5/jars/ivy.jar ...

        [SUCCESSFUL ] org.scala-sbt#ivy;0.13.5!ivy.jar (4051ms)

.......

번호 제목 날짜 조회 수
261 hive기동시 Caused by: java.net.URISyntaxException: Relative path in absolute URI: ${system:java.io.tmpdir%7D/$%7Bsystem:user.name%7D 오류 발생시 조치사항 2016.09.25 617
260 hive metadata(hive, impala, kudu 정보가 있음) 테이블에서 db, table, owner, location를 조회하는 쿼리 2020.02.07 622
259 Query 1234:1234 expired due to client inactivity(timeout is 5m)및 invalid query handle 2022.06.10 626
258 spark-shell실행시 "A read-only user or a user in a read-only database is not permitted to disable read-only mode on a connection."오류가 발생하는 경우 해결방법 2016.05.20 627
257 Scala에서 countByWindow를 이용하기(예제) 2018.03.08 631
256 spark-submit 실행시 "java.lang.OutOfMemoryError: Java heap space"발생시 조치사항 2018.02.01 641
255 Container killed by the ApplicationMaster. Container killed on request. Exit code is 143 Container exited with a non-zero exit code 143 TaskAttempt killed because it ran on unusable node 오류시 조치방법 2017.04.06 646
254 [Hive canary]Hive에 Metastore canary red alert및 hive log파일에 Duplicate entry '123456' for key 'NOTIFICATION_LOG_EVENT_ID'가 발생시 조치사항 2023.03.10 647
253 [Kudu]ERROR: Unable to advance iterator for node with id '2' for Kudu table 'impala::core.pm0_abdasubjct': Network error: recv error from unknown peer: Transport endpoint is not connected (error 107) 2023.03.16 647
252 Error: Could not find or load main class nodemnager 가 발생할때 해결하는 방법 2015.06.05 652
251 db를 통째로 새로운 이름의 db로 복사하는 방법/절차 2017.11.14 652
250 Error: java.lang.RuntimeException: java.lang.OutOfMemoryError 오류가 발생하는 경우 2018.09.20 654
249 kudu의 내부 table명 변경하는 방법 2022.11.10 656
248 [Atlas Server]org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient permissions (user=atlas/node01.gooper.com@GOOPER.COM, scope=default:atlas_janus, params=[table=default:atlas_janus,], action-CREATE)] 2023.05.15 659
247 Kafka Offset Monitor로 kafka 상태 모니터링 하기 file 2016.11.08 663
246 [HDFS]Encryption Zone에 생성된 테이블 조회시 Failed to open HDFS file hdfs://nameservice1/tmp/zone1/sec_test_file.txt Error(255): Unknown error 255 Root cause: AuthorizationException: User:impala not allowd to do 'DECRYPT_EEK' on 'testkey' 2023.06.29 663
245 Job이 끝난 log을 볼수 있도록 설정하기 2016.05.30 664
244 동시에 많은 요청이 endpoint로 몰려서java.net.NoRouteToHostException가 발생하는 경우의 처리방법 2016.10.17 664
243 compile할때와 exclude할때 대상을 표현하는 명칭이 다르므로 주의할것 2016.08.10 669
242 초기 오류(java.lang.NoSuchMethodError)에 따른 후속 작업에서 오류(java.lang.NoClassDefFoundError)가 발생되는 상황(quartz에서 주기적으로 작업시) 2016.08.29 670
위로