Download Mesos 0.9.0-incubating
System Requirements:
-
g++ 4.1 or higher.
-
Python 2.6 (for the Mesosweb UI). On Mac OS X 10.6 or earlier, get Python from MacPortsvia portinstall python26,because OS X's version of Python is not 64-bit.
-
Python 2.6 developerpackages (on red-hat - sudo yum install python26-devel python-devel)
-
cppunit (for buildingzookeeper) (on red-hat - sudo yum install cppunit-devel)sudo
-
Java JDK 1.6 or higher. MacOS X 10.6 users will need to install the JDK fromhttp://connect.apple.com/and setJAVA_HEADERS=/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers.
Process:
- 安装libtool和automake
sudo apt-get install libtool
sudo apt-get install automake
- g++
sudo apt-get install g++
- 安装Python2.6,版本2.7可能会报libpython2.6.so.1 cannot find error
- 安装Python2.6 developer packages
- 安装cppunit
sudo apt-get install libcppunit-dev
- 安装JavaJDK 1.6 or higher
Build Mesos
./bootstrap
./configure --with-webui --with-included-zookeeper --with-java-home=DIR
make
make check
Alternatively (and recommended), use a remote build directory:
mkdir build
cd build
../configure
make
make check
make install
也可以不安装,所以最后一步 make install 可以不执行,这样就需要手动启动master和slaves
Run and Test
Currently, in order to run the example frameworks (in src/examples), you must first build the test suite, as instructed below.
After you build Mesos by running the make
command, you can build and run its example frameworks and unit tests (which use the example frameworks) by issuing the make check
command from the directory where you ran the make
command.
After you have done this, you can also set up a small Mesos cluster and run a job on it as follows:
- Go into the directory where you built Mesos.
- Type
bin/mesos-master.sh
to launch the master. - Take note of the IP and port that the master is running on, which will look something like
192.168.0.1:5050
. Note: In this example the IP address of master is 192.168.0.1, and the port is 5050. We will continue to use the URL shown here for the rest of this example; however when you run the following commands replace all instances of it with the URL of your master. - URL of master:
192.168.0.1:5050
- View the master's web UI at
http://[hostname of master]:8080
. - Launch a slave by typing
bin/mesos-slave.sh --master=192.168.0.1:5050
. The slave will show up on the master's web UI if you refresh it. - Run the C++ test framework (a sample that just runs five tasks on the cluster) using
src/test-framework 192.168.0.1:5050
. It should successfully exit after running five tasks. - You can also try the example python or Java frameworks, with commands like the following:
src/examples/java/test-framework 192.168.0.1:5050
src/examples/python/test-framework 192.168.0.1:5050
Note:c++ test framework will halt and master node needs set some environment variable and add following lines into .profile
export MESOS_HOME=$HOME/mesos-0.9.0
export MESOS_NATIVE_LIBRARY=$MESOS_HOME/src/.libs/libmesos.so
export LD_LIBRARY_PATH=$MESOS_HOME/src/.libs