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. UVALive 2517 Moving Object Recognition(模拟)

    题目看上去很吓人,很高端,但其实很简单,不要被吓到,照搬题目的公式就可以了. 方法:用BFS求出最大块和重心,找出题目公式需要的未知量,然后套到题目公式里就可以求出答案了. 代码: #include& ...

  2. cocos2d-x 3.x随机数

    1.使用标准库std::rand()函数 rand();//产生0~RAND_MAX(0x7fff=32767)间的int类型随机数 rand()%;//产生0~5间的int类型随机数,不包括5 2. ...

  3. unity LineRenderer

    using UnityEngine; using System.Collections; public class Spider:MonoBehaviour { private LineRendere ...

  4. 阅读 LdrInitializeThunk

    参考: http://blog.csdn.net/hw_henry2008/article/details/6568255 Windows 的 DLL 装入(除 ntdll.dll 外)和连接是通过 ...

  5. Windows API 之 CreateToolhelp32Snapshot

    CreateToolhelp32Snapshot: 参考: https://msdn.microsoft.com/en-us/library/ms682489%28VS.85%29.aspx HAND ...

  6. LISTVIEW嵌套GRIDVIEW的一些处理(点击GRIDVIEW的条目,能够显示他在LISTVIEW中的位置)(对这篇文章的优化处理,不每次都new onItemClickListener)

    前几天写了点击GRIDVIEW的条目,能够显示他在LISTVIEW中的位置,当时的处理是在ListView的适配器里的GetView方法里每次都new GridView的onItemClickList ...

  7. 第13章 Swing程序设计----常用面板

    面板也是一个Swing容器,它可以作为容器容纳其他组件,但它也必须被添加到其他容器中. Swing常用的面板包括JPanel面板和JScrollPanel面板. 1.JPanel面板 import j ...

  8. Sphinx配置过程

    http://www.oschina.net/question/84274_11938 http://www.ibm.com/developerworks/library/os-php-sphinxs ...

  9. JSP标准标签库(JSTL)--JSTL简介与安装

    对于MVC设计模式来讲,我们一直强调,在一个JSP钟scriptlet代码越少越好,但是只靠以前的概念很难实现,因为标签的开发特别麻烦,所以为了简化标签,也为了让标签更具备一些通用性,所以一般在开发中 ...

  10. ubuntu 14.0.4下安装有道字典

    一,下载安装包地址:http://codown.youdao.com/cidian/linux/youdao-dict_1.0.2~ubuntu_i386.deb http://codown.youd ...