下载JDK1.8、tomcat8、Maven、Spark、Scala
wget http://download.oracle.com/otn-pub/java/jdk/8u45-b14/jdk-8u45-linux-x64.tar.gz
wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-8/v8.0.22/bin/apache-tomcat-8.0.22.tar.gz
wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz
wget http://www.scala-lang.org/files/archive/scala-2.10.4.tgz
解压JDK:
tar -zxvf jdk-8u45-linux-x64.tar.gz
配置JDK环境变量:
vi /etc/profile
export JAVA_HOME=/var/develop/jdk1.8.0_45
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
source /etc/profile
验证JDK是否安装成功:
java -version
解压tomcat:
tar -zxvf apache-tomcat-8.0.22.tar.gz
验证tomcat:
进入 bin目录下,启动tomcat: ./startup.sh
打开浏览器,查看是否启动成功。
解压maven:
tar -zxvf apache-maven-3.2.5-bin.tar.gz
配置Maven环境变量:
vi /etc/profile
export M2_HOME=/var/develop/apache-maven-3.2.5
export PATH=$PATH:$M2_HOME/bin
export PATH=$PATH:$M2_HOME/bin
source /etc/profile
验证Maven:
mvn -v
配置maven repository目录:
修改conf目录下settings.xml
增加:
<localRepository>/var/develop/apache-maven-3.2.5/repo</localRepository>
解压Scala:
tar -zxvf scala-2.10.4.tgz
配置Scala环境变量:
vi /etc/profile
export SCALA_HOME=/var/develop/scala-2.10.4
export PATH=$PATH:$SCALA_HOME/bin
export PATH=$PATH:$SCALA_HOME/bin
source /etc/profile
验证Scala是否安装成功:
scala -version
移除之前测试下载的spark文件夹以及文件夹内的所有文件:
rm -rf spark/
解压spark:
tar zxvf spark-1.3.0.tgz
配置Spark环境变量:
vi /etc/profile
export SPARK_HOME=/var/develop/spark-1.3.0
export PATH=$PATH:$SPARK_HOME/bin
source /etc/profile
配置Spark:
cp slaves.template slaves
vi slaves
localhost改为master
cp spark-env.sh.template spark-env.sh
vi spark-env.sh
Build spark
进入根目录:
//此步非必须
export MAVEN_OPTS="-Xmx1g -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512m"
//此步是漫长的等待,可以去忙别的了
mvn -Pyarn -Phadoop-2.4 -Dhadoop.version=2.4.0 -DskipTests clean package
进入sbin
运行:./start-all.sh
验证是否成功运行:打来浏览器:8080端口