spark安装

0ve6wy6x  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(337)

请有人帮帮我,我正在尝试在haoopYarn上安装spark,我遇到以下错误:

org.apache.spark.SparkException: Yarn application has already ended! It might have been killed or unable to launch application master.
        at org.apache.spark.scheduler.cluster.YarnClientSchedulerBackend.waitForApplication(YarnClientSchedulerBackend.scala:113)
        at org.apache.spark.scheduler.cluster.YarnClientSchedulerBackend.start(YarnClientSchedulerBackend.scala:59)
        at org.apache.spark.scheduler.TaskSchedulerImpl.start(TaskSchedulerImpl.scala:141)
        at org.apache.spark.SparkContext.<init>(SparkContext.scala:379)
java.lang.NullPointerException
    at org.apache.spark.sql.SQLContext.<init>(SQLContext.scala:141)
    at org.apache.spark.sql.hive.HiveContext.<init>(HiveContext.scala:49)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

hadoop守护进程包括:

4064 SecondaryNameNode
3478 NameNode
4224 ResourceManager
4480 NodeManager
3727 DataNode
6279 Jps

和bash文件:

export JAVA_HOME=/home/user/hadoop-two/jdk1.7.0_71
export HADOOP_INSTALL=/home/user/hadoop-two/hadoop-2.6.0
export PATH=$PATH:$HADOOP_INSTALL/bin
export PATH=$PATH:$HADOOP_INSTALL/sbin
export HADOOP_MAPRED_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_HOME=$HADOOP_INSTALL
export HADOOP_HDFS_HOME=$HADOOP_INSTALL
export YARN_HOME=$HADOOP_INSTALL
export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_INSTALL/lib/native
export HADOOP_OPTS="-Djava.library.path=$HADOOP_INSTALL/lib"
export HADOOP_CONF_DIR=$HADOOP_INSTALL/etc/hadoop
export YARN_CONF_DIR=$HADOOP_INSTALL/etc/hadoop
export SPARK_HOME=/home/user/hadoop-two/spark-1.4.0
d6kp6zgx

d6kp6zgx1#

安装spark,并在上面设置环境变量的同时进行配置。配置 JAVA_HOME and HADOOP_CONF_DIRconf/spark-env.sh 文件:

export HADOOP_CONF_DIR=/home/user/hadoop-2.7.1/etc/hadoop
export JAVA_HOME=/home/user/jdk1.8.0_60

并在spark conf目录中定义slave(输入slave的dns名称):

conf/slaves

使用以下命令启动Yarn上的Spark:

bin/spark-shell --master yarn-client

你就这么做了!!!!

相关问题