Spark的HA部署

一、安装JDK、Scala

二、安装zookeeper

三、安装Hadoop

四、安装Spark

  1、修改spark/conf/spark-env.sh 

    export JAVA_HOME=/usr/java/jdk1.8.0_65
    export SCALA_HOME=/usr/scala-2.11.8
    export HADOOP_HOME=/usr/hadoop-2.7.2
    export HADOOP_CONF_DIR=/usr/hadoop-2.7.2/etc/hadoop
    export SPARK_MASTER_IP=node1
    export SPARK_DAEMON_JAVA_OPTS="-Dspark.deploy.recoveryMode=ZOOKEEPER -Dspark.deploy.zookeeper.url=node1:2181,node2:2181,node3:2181 -Dspark.deploy.zookeeper.dir=/spark"
    export SPARK_WORKER_MEMORY=1g
    export SPARK_EXECUTOR_MEMORY=1g
    export SPARK_DRIVER_MEMORY=1G
    export SPARK_WORKER_CORES=2

  2、修改 spark/conf/slaves  

    node2
    node3
    node4

  3、修改 spark/conf/spark-defaults.conf

    spark.executor.extraJavaOptions -XX:+PrintGCDetails -Dkey=value -Dnumbers="one two three"
    spark.eventLog.enabled true
    spark.eventLog.dir hdfs://mycluster/historyServerforSpark
    spark.yarn.historyServer.address node1:18080
    spark.history.fs.logDirectory hdfs://mycluster/historyServerforSpark

  4、需要到hdfs 系统上创建/historyServerforSpark目录

  5、复制到各个机器上

  6、启动spark集群和启动history-serve

   ./start-all.sh

   ./start-history-server.sh

 

PS:其他机器的master需要在其他机器运行./start-master.sh

 

posted @ 2016-07-01 10:43  julyme  阅读(326)  评论(0编辑  收藏  举报