环境:
hadoop2.6.4
jdk1.8
centos4.8
步骤如下:
1.在Apache官网下载Spark2.3.1的安装包
2.上传到Linux并解压
tar -zxvf spark-2.3.1-bin-hadoop2.6.tgz -C /usr/local/
3.进入spark-2.3.1-bin-hadoop2.6/conf
cd /usr/local/spark-2.3.1-bin-hadoop2.6/conf
3.1 配置文件spark-env.sh(从spark-env.sh.template拷贝即可)
cp spark-env.sh.template spark-env.sh
export JAVA_HOME=/usr/java/jdk1.8.0_151
export HADOOP_CONF_DIR=/usr/local/hadoop-2.6.4/etc/hadoop/
export SPARK_MASTER_IP=master
export SPARK_MASTER_PORT=7077
export SPARK_WORKER_MEMORY=512m
export SPARK_WORKER_CORES=1
export SPARK_EXECUTOR_MEMORY=512m
export SPARK_EXECUTOR_CORES=1
export SPARK_WORKER_INSTANCES=1
3.2 配置文件 slaves(从slaves.template拷贝)
删除内容,并添加
slave1
slave2
slave3
3.3 配置文件spark-defaults.conf (从spark-def