1)hosts配置 hadoop101 hadoop102 hadoop103 2)免密操作
ssh-keygen -t rsa
ssh-copy-id hadoop101
ssh-copy-id hadoop102
ssh-copy-id hadoop103
yum -y install ntpdate ntpdate time.windows.com 3) 安装3台都配置
mkdir /itcast
tar -zxvf spark-2.4.3-bin-hadoop2.7.tgz
mv spark-2.4.3-bin-hadoop2.7 spark
cd spark
修改配置文件 cd conf mv spark-env.sh.template spark-env.sh vim spark-env.sh 添加如下:
export JAVA_HOME=/usr/local/jdk1.8.0_181
export SPARK_MASTER_HOST=hadoop101
export SPARK_MASTER_PORT=7077
mv slaves.template slaves vim slaves
hadoop101
hadoop102
hadoop103
scp -r spark/ hadoop102:/itcast/ scp -r spark/ hadoop103:/itcast/
vim /etc/profile
export SPARK_HOME=/itcast/spark
export PATH=$PATH:$SPARK_HOME/bin
export PATH=$PATH:$SPARK_HOME/sbin
cd /itcast/spark/sbin ./start-all.sh #启动 webui地址: http://192.168.66.101:8080/
|