centos7(vm)下spark-2.0.2-bin-hadoop2.7.tgz单机模式的安装验证(x86)

1.vm安装(略)

2.软件下载

spark-2.0.2-bin-hadoop2.7.tgz​

jdk-8u77-linux-x64.tar

scala-2.10.4

3.软件安装

a.安装jdk

#rpm -qa | grep java

​​#rpm -e --nodepsjava-1.8.0-openjdk-1.8.0.65-3.b17.el7.x86_64

...... 删除默认安装的openjdk

#​cp jdk-8u77-linux-x64.tar.gz/root/java/

#​tar -zxvfjdk-8u77-linux-x64.tar.g

#vi /etc/profile----修改环境变量

​#JAVA

export JAVA_HOME=/root/java/jdk1.8.0_77

export JRE_HOME=$JAVA_HOME/jre

export PATH=$PATH:$JAVA_HOME/bin

exportCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

​wq!  退出

#source/etc/profile   生效

b.安装scala

#​wgethttp://www.scala-lang.org/files/archive/scala-2.10.4.tgz

#​tar -zxvf scala-2.10.4.tgz

#vi /etc/profile

​​#SCALA

export SCALA_HOME=/root/spark/scala-2.10.4

export PATH=$PATH:$SCALA_HOME/bin

#source /etc/profile

注:检查java和scala安装  #java-version    &   scala-version

c.安装spark

#​tar -zxvfspark-2.0.2-bin-hadoop2.7.tgz

#cd spark-2.0.2-bin-hadoop2.7/

#​bin/spark-shell

[root@localhost spark-2.0.2-bin-hadoop2.7]#bin/spark-shell

[root@localhost spark-2.0.2-bin-hadoop2.7]# bin/spark-shell
Using Spark's default log4j profile: org/apache/spark/log4j-defaults.properties
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel).
16/12/11 18:49:40 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/12/11 18:49:42 WARN Utils: Your hostname, localhost.localdomain resolves to a loopback address: 127.0.0.1; using 192.168.1.221 instead (on interface eno16777736)
16/12/11 18:49:42 WARN Utils: Set SPARK_LOCAL_IP if you need to bind to another address
16/12/11 18:49:52 WARN SparkContext: Use an existing SparkContext, some configuration may not take effect.
Spark context Web UI available at http://192.168.1.221:4040
Spark context available as 'sc' (master = local[*], app id = local-1481453390502).
Spark session available as 'spark'.
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /___/ .__/\_,_/_/ /_/\_\   version 2.0.2
      /_/
         
Using Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_77)
Type in expressions to have them evaluated.
Type :help for more information.

scala> sc
res0: org.apache.spark.SparkContext = org.apache.spark.SparkContext@49653791

scala>

4.安装测试​

关闭防火墙

centos7(vm)下spark-2.0.2-bin-hadoop2.7.tgz单机模式的安装验证(x86)_第1张图片

你可能感兴趣的:(spark)