• Hadoop 单机搭建 Spark单机搭建


    spark下载地址:http://spark.apache.org/downloads.html

    spark版本:spark-3.0.0-preview2-bin-hadoop2.7

    一、下载并上传解压安装包

    tar -xvf spark-3.0.0-preview2-bin-hadoop2.7.tar -C /opt/modules/

    二、修改配置文件,配置文件都在安装目录的conf文件夹中

    /opt/modules/spark-3.0.0-preview2-bin-hadoop2.7/conf

    1、修改spark-env.sh文件

    [hadoop@centos01 conf]$ cp spark-env.sh.template spark-env.sh
    [hadoop@centos01 conf]$ vi spark-env.sh
    
    export JAVA_HOME=/opt/modules/jdk1.8.0_181
    export SPARK_MASTER_IP=centos01
    export SPARK_MASTER_PORT=7077

    三、启动

    sh /opt/modules/spark-3.0.0-preview2-bin-hadoop2.7/sbin/start-master.sh
    [hadoop@centos04 conf]$ sh /opt/modules/spark-3.0.0-preview2-bin-hadoop2.7/sbin/start-master.sh
    starting org.apache.spark.deploy.master.Master, logging to /opt/modules/spark-3.0.0-preview2-bin-hadoop2.7/logs/spark-hadoop-org.apache.spark.deploy.master.Master-1-centos04.out
    [hadoop@centos04 conf]$ 

    四、查看节点

    [hadoop@centos04 conf]$ jps
    10579 Master
    11427 Jps
    [hadoop@centos04 conf]$ 

    五、测试

    http://192.168.0.181:8080/

    连接spark-shell
    sh /opt/modules/spark-3.0.0-preview2-bin-hadoop2.7/bin/spark-shell --master spark://192.168.0.181:7077
    [hadoop@centos04 conf]$ sh /opt/modules/spark-3.0.0-preview2-bin-hadoop2.7/bin/spark-shell --master spark://192.168.0.181:7077
    20/03/21 00:40:22 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
    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). For SparkR, use setLogLevel(newLevel).
    Spark context Web UI available at http://centos04:4040
    Spark context available as 'sc' (master = spark://192.168.0.181:7077, app id = app-20200321004034-0000).
    Spark session available as 'spark'.
    Welcome to
          ____              __
         / __/__  ___ _____/ /__
        _ / _ / _ `/ __/  '_/
       /___/ .__/\_,_/_/ /_/\_   version 3.0.0-preview2
          /_/
             
    Using Scala version 2.12.10 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_181)
    Type in expressions to have them evaluated.
    Type :help for more information.
    
    
    scala> :quit
    [hadoop@centos04 conf]$ 

    结束

  • 相关阅读:
    E
    D
    Npp ChangeLog
    c++ 书籍(zz)
    再好的工作是为了更好的生活
    如何将JPG格式的图片转换成PNG格式
    点分治
    团体程序设计天梯赛(CCCC) L3021 神坛 的一些错误做法(目前网上的方法没一个是对的) 和 一些想法
    团体程序设计天梯赛(CCCC) L3019 代码排版 方法与编译原理密切相关,只有一个测试点段错误
    团体程序设计天梯赛(CCCC) L3015 球队“食物链” 状态压缩
  • 原文地址:https://www.cnblogs.com/xuchen0117/p/12535992.html
Copyright © 2020-2023  润新知