For currently popular distributed framework Spark, here it shows the intro and steps to configure the spark standalone mode on several machines.

It is easy to configure it from stratch.  The following instruction I note down is based on the spark-2.0.2-bin-hadoop2.7 as example on the linux debian machines for scala programming.

Assume you have two machines with IP: 192.168.0.51 and 192.168.0.52

1.  Preinstall java, scala, sbt

check: https://www.scala-lang.org/download/install.html

http://www.scala-sbt.org/0.13/docs/Installing-sbt-on-Linux.html

2. Download prebuilt spark version with hadoop. or you can compile on your own 

the link can be referenced: https://spark.apache.org/downloads.html

3. Unzip the file and create the link for easy visit later

e.g.   execute: ln -s /usr/local/spark-2.0.2-bin-hadoop2.7 /usr/local/spark
 
4. Configure the spark environments:
 (1) configure slaves file:   /usr/local/spark-2.0.2-bin-hadoop2.7/conf/slaves
# A Spark Worker will be started on each of the machines listed below.
192.168.0.51
192.168.0.52
 
(2) configure spar_env.sh.               e.g.
#spark-env.sh
export SCALA_HOME=/usr/local/scala
export JAVA_HOME=/home/local/jdk
#export SPARK_LOCAL_IP=localhost
export SPARK_EXECUTOR_MEMORY=6g
export SPARK_EXECUTOR_CORES=6
export SPARK_MASTER_IP=192.168.0.51
export SPARK_MASTER_PORT=8070
export SPARK_MASTER_WEBUI_PORT=8080
#export SPARK_WORKER_INSTANCES=1
export SPARK_WORKER_PORT=8092
#export SPARK_WORKER_MEMORY=4g
#export SPARK_WORKER_CORES=4
 
5.  Set up passwordless ssh access key
  (1) Generate ssh key without password

$ ssh-keygen -t rsa -P ""

(2) Copy id_rsa.pub to authorized-keys

$  cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys

(3) Start ssh localhost           if you want to work in only one localhost machine for spark standalone

 $ ssh localhost
 
6. Start spark

$SPARK_HOME/sbin/start-all.sh
 execute  jps  to check worker and master have been up
 
7. Write and run your application

 

execute:  sbt package 
 
execute:  $SPARK_HOME/bin/spark-submit \
      --class "main.scala.MainAppTest" \
      --master local[4] \
      xxxxxxxx.jar 
 
 
 
 
 

Spark Standalone Mode Configuration的更多相关文章

  1. (二)win7下用Intelij IDEA 远程调试spark standalone 集群

    关于这个spark的环境搭建了好久,踩了一堆坑,今天 环境: WIN7笔记本  spark 集群(4个虚拟机搭建的) Intelij IDEA15 scala-2.10.4 java-1.7.0 版本 ...

  2. 【原】Spark Standalone模式

    Spark Standalone模式 安装Spark Standalone集群 手动启动集群 集群创建脚本 提交应用到集群 创建Spark应用 资源调度及分配 监控与日志 与Hadoop共存 配置网络 ...

  3. Spark standalone模式的安装(spark-1.6.1-bin-hadoop2.6.tgz)(master、slave1和slave2)

     前期博客  Spark运行模式概述 Spark standalone简介与运行wordcount(master.slave1和slave2) 开篇要明白 (1)spark-env.sh 是环境变量配 ...

  4. spark standalone ha spark submit

    when you build a spark standalone ha cluster, when you submit your app,  you should send it to the l ...

  5. Spark standalone HA

    配置Spark standalone HA 主机:node1,node2,node3 master: node1,node2 slave:node2,node3 修改配置文件: node1,node3 ...

  6. spark standalone zookeeper HA部署方式

    虽然spark master挂掉的几率很低,不过还是被我遇到了一次.以前在spark standalone的文章中也介绍过standalone的ha,现在详细说下部署流程,其实也比较简单. 一.机器 ...

  7. Windows下IntelliJ IDEA中运行Spark Standalone

    ZHUAN http://www.cnblogs.com/one--way/archive/2016/08/29/5818989.html http://www.cnblogs.com/one--wa ...

  8. Spark standalone安装(最小化集群部署)

    Spark standalone安装-最小化集群部署(Spark官方建议使用Standalone模式)        集群规划:    主机        IP                    ...

  9. Spark Standalone模式应用程序开发

    作者:过往记忆 | 新浪微博:左手牵右手TEL | 能够转载, 但必须以超链接形式标明文章原始出处和作者信息及版权声明博客地址:http://www.iteblog.com/文章标题:<Spar ...

随机推荐

  1. Spring Security教程系列(一)基础篇-1

    第 1 章 一个简单的HelloWorld 第 1 章 一个简单的HelloWorld Spring Security中可以使用Acegi-1.x时代的普通配置方式,也可以使用从2.0时代才出现的命名 ...

  2. Qzone 高性能 HTTPS 实践

    WeTest导读 自从去年QQ空间移动端页面开始切换到HTTPS之后,页面性能遇到了比较大的挑战,HTTPS对页面访问速度带来了比较大的影响,所以我们通过实践总结了一些能够提升HTTPS页面访问速度的 ...

  3. React学习小结(三)

    一.React数据的传输 1.属性和状态是react中数据传递的载体 2.属性是声明以后不允许被修改的东西 3.属性只能在组件初始化的时候声明并传入组件内部,并且在组件内部通过this.props获取 ...

  4. DOM知识梳理

    DOM 我们知道,JavaScript是由ECMAScript + DOM + BOM组成的.ECMAScript是JS中的一些语法,而BOM主要是浏览器对象(window)对象的一些相关知识的集合. ...

  5. struts2 Unable to load configuration. - bean - jar:file:struts2-core-2.2.3.jar!/struts-default.xml:29:72

    今天启动tomcat的时候发现如下错误记录一下! 从stackoverflow上找到 原因是加入了多个struts2包 删除相同的包即可!!

  6. shiro开发,shiro的环境配置(基于spring+springMVC+redis)

    特别感谢lhacker分享的文章,对我帮助很大 http://www.aiuxian.com/article/p-1913280.html 基本的知识就不在这里讲了,在实战中体会shiro的整体设计理 ...

  7. java控件之树形结构JTree

    import javax.swing.JFrame; import javax.swing.JTree; import javax.swing.event.TreeSelectionEvent; im ...

  8. http服务器开发笔记(一)——先跑起来

    做了很多年的web相关开发,从来也没有系统的学习http协议,最近正好工作不怎么忙,准备系统的学习一下. 接下来准备自己写一小型的http服务器来学习,因为现在对JavaScript比较熟悉,所以决定 ...

  9. [bzoj4872]分手是祝愿

    Description Zeit und Raum trennen dich und mich. 时空将你我分开.B 君在玩一个游戏,这个游戏由 n 个灯和 n 个开关组成,给定这 n 个灯的初始状态 ...

  10. js判断是否是ie浏览器且给出ie版本

    之前懒得写判断ie版本js,因为网上关于这方面的代码太多了,所以从网上拷贝了一个,放到项目上才发现由于时效性的问题,代码不生效.就自己写一个吧. 怎么去看浏览器的内核等信息 ---- js的全局对象w ...