Data Engineering/Spark

[Linux/Spark] Apache Spark를 설치해보자

seoraroong 2024. 8. 22. 00:00

https://spark.apache.org/downloads.html

 

Downloads | Apache Spark

Download Apache Spark™ Choose a Spark release: Choose a package type: Download Spark: Verify this release using the and project release KEYS by following these procedures. Note that Spark 3 is pre-built with Scala 2.12 in general and Spark 3.2+ provides

spark.apache.org

 

Firefox → Apache Spark download → 다운로드 링크 복사

 

- wget 과 복사한 링크를 이용해 spark 패키지를 다운로드 받고 압축 풀기

 

- spark-3.5.1-bin-hadoop3으로 된 파일 이름을 간단하게 spark로 변경하기

 

- bashrc 파일에 spark 홈 경로를 추가하기

gedit ~/.bashrc

 

설정을 적용하기 위해 sorce 명령어 실행

source ~/.bashrc

 

- spark 실행해보기

spark-shell

 

- 간단한 실습 : 1000까지의 숫자를 포함하는 MyRange를 만들고 짝수만 출력하는 변수를 만들기