:::warning
注意:Spark 單機使用 YARN 排程,須先安裝 Hadoop
:::
Type | Version |
---|---|
OS | Ubuntu 14.04 |
Spark | 2.0.0 |
cd /opt
sudo wget http://archive.apache.org/dist/spark/spark-2.0.0/spark-2.0.0-bin-hadoop2.7.tgz
sudo tar -xvf spark-2.0.0-bin-hadoop2.7.tgz
sudo mv spark-2.0.0-bin-hadoop2.7 spark
sudo chmod -R 777 /opt/
sudo chown ${USER_NAME}:${USER_NAME} -R /opt/spark
sudo mv spark-env.sh.template spark-env.sh
sudo vim spark-env.sh
## 新增以下幾行
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
export SPARK_HOME=/opt/spark
export PATH=$SPARK_HOME/bin:$PATH
sudo vim ~/.bashrc
## 新增以下幾行
export SPARK_HOME="/opt/spark"
export PATH=$SPARK_HOME/bin:$PATH
source ~/.bashrc