spark安装
- 解压,设置/etc/profile
tar -zxvf ...gz
- 配置子节点
cd $SPARK_HOME/conf
cp slaves.template slaves
vim slaves
lx82
lx83
- 配置spark环境
cp spark-env.sh.template spark-env.sh
vim spark-env.sh
SPARK_MASTER_HOST=lx81
SPARK_MASTER_PORT=7077
export SPARK_DIST_CLASSPATH=$(/program/hadoop/bin/hadoop classpath)
spark使用
- 例子
./spark/bin/run-example SparkPi 2>&1 | grep "Pi is roughly"
- scala交互模式
./spark/bin/spark-shell