Published on

Set Up Spark

Overview

A post on the new features introduced in v1.0. New features:


Cài đặt Windows Subsystem for Linux (WSL)

Nếu bạn chưa cài đặt WSL trên máy tính Windows của mình, hãy làm theo hướng dẫn chính thức của Microsoft để cài đặt WSL 2: Hướng dẫn cài đặt WSL

Mở PowerShell và chạy lệnh:

WSL --install -d Ubuntu

Cài đặt Java

Mở terminal của Ubuntu trong WSL.

sudo apt-get update
sudo apt-get install openjdk-8-jre

Tải về và giải nén Apache Spark:

wget https://downloads.apache.org/spark/spark-3.1.2/spark-3.1.2-bin-hadoop3.2.tgz
tar -xvf spark-3.1.2-bin-hadoop3.2.tgz

Thiết lập biến môi trường cho Apache Spark

export SPARK_HOME=/đường/dẫn/tới/thư/mục/giải/nén/spark-3.1.2-bin-hadoop3.2
export PATH=$PATH:$SPARK_HOME/bin

Tạo key ssh và setup notebook trong WSL

Mở cmd của Ubuntu vừa cài đặt ở trên.

  1. Tạo thư mục chứ key ssh : mkdir -p ~/.ssh
  2. Tạo key ssh (nếu chưa có): ssh-keygen
  3. Copy nội dung key: ~/.ssh/id_rsa.pub