It is very easy to install a Spark cluster (Standalone mode). In my example, I used three machines.

All machines run a OS of ubuntu 12.04 32bit. One machine is named "master", the other two are

named "node01" and "node02" respectively. The name of a machine can be set in:  /etc/hostname.

Further more, every nodes (machines) should the same user name.

1. On every node: Install Java and set Java environment in ~/.bashrc as:

  #set java environment

  export JAVA_HOME=/usr/local/jdk1.7.0_67

  export JRE_HOME=$JAVA_HOME/jre

  export PATH=$JAVA_HOME/bin:$PATH

  export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib

Note that in my example, I used Java jdk1.7.0_67 and put it under /usr/local.

2. On every node: Install Scala and set corresponding environment variables in ~/.bashrc as:

export SCALA_HOME=/usr/local/scala-2.10.4

export PATH=$SCALA_HOME/bin:$PATH

Note that in my example, I used Scala scala-2.10.4 and put it under /usr/local.

3. On every node: Install Spark.

Download any version of Spark from http://spark.apache.org/downloads.html , in my example, I

chose spark-1.1.0-bin-hadoop2.4.tgz and extract it to /usr/local.

    Set in ~/.bashrc:

export SPARK_HOME=/usr/local/spark-1.1.0-bin-hadoop2.4

4. Set up ssh such that every two nodes in the cluster can ssh each other without password. This step

is also needed when you set up a hadoop cluster, there are abundant tutorials on the Internet, so

the details is omitted here.

5. On every node:

  $ sudo vim /etc/hosts

and set the IP address of the nodes in the network. For example, I set the hosts file on every node to:

  127.0.0.1        localhost

  223.3.86.xxx  master

  223.3.81.xxx  node01

  223.3.70.xxx  node02

6. On master node: Enter the root folder of Spark, and edit con/slaves. In my example:

  $ cd /usr/local/spark-1.1.0-bin-hadoop2.4

  $ sudo vim conf/slaves

Edit slaves file to:

  master

  node01

  node02

7. On master node: Enter the root folder of Spark and start spark cluster.

  $ cd /usr/local/spark-1.1.0-bin-hadoop2.4

  $ sbin/start-all.sh

8. Open http://master:8080/ using your web browser to monitoring the cluster.

9. Run Spark examples:

Locally:

$ MASTER=local[4] $SPARK_HOME/bin/run-example SparkLR

On cluster:

$ MASTER=spark://master:7077 $SPARK_HOME/bin/run-example SparkLR

For any questions, feel free to contact me.  Email: wuzimian2006@163.com  QQ: 726590906

Spark Standalone Mode的更多相关文章

  1. 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 ...

  2. Spark standalone HA

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

  3. spark standalone zookeeper HA部署方式

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

  4. Windows下IntelliJ IDEA中运行Spark Standalone

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

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

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

  6. 【原】Spark Standalone模式

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

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

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

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

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

  9. Spark Standalone Mode Configuration

    For currently popular distributed framework Spark, here is the intro and step to configure the spark ...

  10. Spark Standalone spark-env.sh

    export JAVA_HOME=/app/jdk export SPARK_MASTER_PORT=7077 export SPARK_MASTER_WEBUI_PORT=8080 export S ...

随机推荐

  1. apache-tomcat-7.0.70无法进入Manager管理App项目

    在tomcat文件夹找到conf文件夹中的tomcat-user.xml文件,用记事本打开,在最下面可以看到tomcat默认把用户注释掉了,也就是说打开tomcat主页是进不去管理页面的.方法如下:找 ...

  2. 转:LoadRunner获取毫秒及字符串替换实现

    今天做一个性能测试,参数化要求创建用户名不可以重复,想来想不没有什么好的办法来避免用户名字的重复.所以就想用时间+随机数来实现,但是实现中遇到一个问题. 名字中不可以包含.这个特殊的字符的.所以要处理 ...

  3. HDU1372,BFS象棋马走日

    简单的对于bfs的运用,但是还是写的太慢了写了TMD的1H,主要是不熟悉,以后慢慢熟悉就好了,模型基本已经能建立了,主要出现bug是在方向数组的运用上面,一定要记得是从0开始的,而不是从1开始的,导致 ...

  4. Javascript面向对象编程(二):构造函数的继承

    这个系列的第一部分,主要介绍了如何"封装"数据和方法,以及如何从原型对象生成实例. 今天要介绍的是,对象之间的"继承"的五种方法. 比如,现在有一个" ...

  5. 用FusionChartsFree做饼状图、柱状图、折线图的实例

    1.先来看看要进行表现的页面:myChart.jsp <%@ page language="java" contentType="text/html; charse ...

  6. msf常用命令

    msf > search -r great -t exploits search命令查找rank为great的exploit msf > setg RHOST 192.168.1.102 ...

  7. PAT (Advanced Level) 1077. Kuchiguse (20)

    最长公共后缀.暴力. #include<cstdio> #include<cstring> #include<cmath> #include<vector&g ...

  8. Commons Codec基本使用(转载)

    在实际的应用中,我们经常需要对字符串进行编解码,Apache Commons家族中的Commons Codec就提供了一些公共的编解码实现,比如Base64, Hex, MD5,Phonetic an ...

  9. 试题公式解决方案--kindeditor集成jmeditor公式web编辑器

    最近在搞一套在线的考试系统,一直为即支持公式编辑又得支持各种附件上传.图片上传.视频音频上传.文字编辑 的web编辑器而犯愁.于是乎试着把 kindeditor和jmeditor集成一下,多了不说了直 ...

  10. js 获取n天前的时间

    <script type="text/javascript"> var strdate = new Date(); var begindate = strdate.ge ...