前提:已解压spark&scala包改名后放于/usr/local/src
cd /usr/local/src/spark/conf/
cp slaves.template slaves
vi slaves
把
localhost
改成
node02
node03
cp spark-env.sh template spark-env.sh
vi spark-env.sh
export JAVA_HOME=/usr/local/src/jdk
export SCALA_HOME=/usr/local/src/scala
export SPARK_MASTER_HOST=192.168.1.80
export SPARK_MASTER_PORT=7077
export SPARK_WORKER_CORES=1
export SPARK_WORKER_INSTANCES=1
export SAPRK_WORKER_MEMORY=700M
export SPARK_MASTER_WEBUI_PORT=8888
export HADOOP_CONF_DIR=/usr/local/src/hadoop/etc/hadoop
cd /usr/local/src/spark/sbin/
vi spark-config.sh
export JAVA_HOME=/usr/local/src/jdk
cd /usr/local/spark/sbin/
./start-all.sh
jps
cd /usr/local/src/spark/bin/
./spark-shell
去网页ping一下4040
192.168.1.80:4040
网页出来则成功!