安装Mesos
Spark-0.4推荐的Mesos版本是1205738,不是最新版的Mesos,我想最新版应该也可以,这里暂且使用1205738。
首先下载Mesos
svn checkout –r 1205738 https://svn.apache.org/repos/asf/incubator/mesos/trunkmesos |
得到mesos目录后,先安装编译所需的软件
apt-get install python2.6 python2.6-dev 很遗憾,虽然Ubuntu 11.04上有python 2.7,但webui(mesos的web界面)需要python 2.6,因此要装 apt-get install libcppunit-dev (安装cppunit) 确保g++版本大于4.1 如果缺automake,那么安装 apt-get install autoconf automake libtool |
由于系统是Ubuntu 11.04 (GNU/Linux 2.6.38-8-generic x86_64)-natty,可以直接使用./configure.template.ubuntu-natty-64。但我使用的JDK是Sun的,因此修改./configure.template.ubuntu-natty-64里面--with-java-home为/opt/jdk1.6.0_27。
总体如下:
cp configure.template.ubuntu-natty-64 configure.template.ubuntu-my-natty-64 修改configure.template.ubuntu-my-natty-64得到如下内容 1 #!/bin/sh 2 export PYTHON=python2.7 3 4 $(dirname $0)/configure \ 5 --with-python-headers=/usr/include/python2.7 \ 6 --with-java-home=/opt/jdk1.6.0_27 \ 7 --with-webui \ 8 --with-included-zookeeper $@ |
编译mesos
root@master:/opt/mesos# ./configure.template.ubuntu-my-natty-64 完了之后 root@master:/opt/mesos# make |
9 配置Mesos和Spark
先在slave1、slave2、slave3和master上安装mesos,我这里安装在/opt/mesos。
进入conf目录,修改deploy-env.sh,添加MESOS_HOME
# This works with a newer version of hostname on Ubuntu. #FULL_IP="hostname --all-ip-addresses" #export LIBPROCESS_IP=`echo $FULL_IP | sed 's/\([^ ]*\) .*/\1/'` export MESOS_HOME=/opt/mesos |
修改mesos.conf,添加
# mesos-slave with --help. failover_timeout=1 |
进入/opt/spark,修改conf/spark-env.sh,添加
# variables to set are: # - MESOS_HOME, to point to your Mesos installation # - SCALA_HOME, to point to your Scala installation # - SPARK_CLASSPATH, to add elements to Spark's classpath # - SPARK_JAVA_OPTS, to add JVM options # - SPARK_MEM, to change the amount of memory used per node (this should # be in the same format as the JVM's -Xmx option, e.g. 300m or 1g). # - SPARK_LIBRARY_PATH, to add extra search paths for native libraries. export SCALA_HOME=/opt/scala-2.9.1.final export MESOS_HOME=/opt/mesos export PATH=$PATH:/opt/jdk1.6.0_27/bin export SPARK_MEM=10g (根据自己机器的内存大小设置,指示Spark可以使用的最大内存量) |