1 install mesos
Install mesos on centos in the following steps.
Necessary System Tools and libraries, run the following command.
$sudo yum groupinstall "Developmenttools"
$sudo yum installjava-1.6.0-openjdk.x86_64 java-1.6.0-openjdk-devel.x86_64 python python-devel libcurllibcurl-devel
Download the mesos source code and install the mesos command line:
$wgethttp://www.apache.org/dist/mesos/0.19.0/mesos-0.19.0.tar.gz
$tar -zxf mesos-0.19.0.tar.gz
$mv mesos-0.19.0 mesos
#./configure --prefix=/opt/mesos &&make && make check && make install
./configure --prefix=/opt/mesos &&make && make install
Note:
1. during compilation, an error is reported, indicating that the javadoc reference fails. The solution is to directly go to the src/Java directory and comment out this line of records in the mesos. Pom file.
2. If the time is not that sufficient, you do not need to run the make check command. The reason is that it takes a long time to execute the validation script program.
2. instance Test
Mesos instances are written in C ++, Java, and python as follows:
# Change into build directory.
$ cd build
# Start mesos master (***Ensure work directory exists and has proper permissions***).
$ ./bin/mesos-master.sh --ip=127.0.0.1 --work_dir=/var/lib/mesos
# Start mesos slave.
$ ./bin/mesos-slave.sh --master=127.0.0.1:5050
# Visit the mesos web page.
$ http://127.0.0.1:5050
C ++ instance:
# Run C++ framework (***Exits after successfully running some tasks.***).
$ ./src/test-framework --master=127.0.0.1:5050
I0721 11:06:55.031108 6857 sched.cpp:126] Version: 0.19.0
I0721 11:06:55.035475 6883 sched.cpp:222] New master detected [email protected]:5050
I0721 11:06:55.036548 6883 sched.cpp:230] No credentials provided.Attempting to register without authentication
I0721 11:06:55.040148 6883 sched.cpp:397] Framework registered with20140721-110017-16777343-5050-6678-0001
Registered!
.Starting task 0 on hadoop-master
Task 0 is in state 1
Task 0 is in state 2
.Starting task 1 on hadoop-master
Task 1 is in state 1
Task 1 is in state 2
.Starting task 2 on hadoop-master
Task 2 is in state 1
Task 2 is in state 2
.Starting task 3 on hadoop-master
Task 3 is in state 1
Task 3 is in state 2
.Starting task 4 on hadoop-master
Task 4 is in state 1
Task 4 is in state 2
I0721 11:06:59.736284 6880 sched.cpp:730] Stopping framework'20140721-110017-16777343-5050-6678-0001'
Java instance:
# Run Java framework (***Exits after successfully running some tasks.***).
$ ./src/examples/java/test-framework 127.0.0.1:5050
omit…
Python instance:
# Run Python framework (***Exits after successfully running some tasks.***).
$ ./src/examples/python/test-framework 127.0.0.1:5050
[[email protected]]$ ./src/examples/python/test-framework 127.0.0.1:5050
I072111:05:07.645002 6807 sched.cpp:126]Version: 0.19.0
I072111:05:07.650837 6813 sched.cpp:222] Newmaster detected at [email protected]:5050
I072111:05:07.652999 6813 sched.cpp:230] Nocredentials provided. Attempting to register without authentication
I072111:05:07.659893 6813 sched.cpp:397]Framework registered with 20140721-110017-16777343-5050-6678-0000
Registeredwith framework ID 20140721-110017-16777343-5050-6678-0000
Got1 resource offers
Gotresource offer 20140721-110017-16777343-5050-6678-0
Acceptingoffer on hadoop-master to start task 0
Task0 is in state 1
Task0 is in state 2
Receivedmessage: 'data with a \x00 byte'
Got1 resource offers
Gotresource offer 20140721-110017-16777343-5050-6678-1
Acceptingoffer on hadoop-master to start task 1
Task1 is in state 1
Task1 is in state 2
Receivedmessage: 'data with a \x00 byte'
Got1 resource offers
Gotresource offer 20140721-110017-16777343-5050-6678-2
Acceptingoffer on hadoop-master to start task 2
Task2 is in state 1
Task2 is in state 2
Receivedmessage: 'data with a \x00 byte'
Got1 resource offers
Gotresource offer 20140721-110017-16777343-5050-6678-3
Acceptingoffer on hadoop-master to start task 3
Task3 is in state 1
Task3 is in state 2
Receivedmessage: 'data with a \x00 byte'
Got1 resource offers
Gotresource offer 20140721-110017-16777343-5050-6678-4
Acceptingoffer on hadoop-master to start task 4
Task4 is in state 1
Task4 is in state 2
Alltasks done, waiting for final framework message
Receivedmessage: 'data with a \x00 byte'
Alltasks done, and all messages received, exiting
I072111:05:14.626263 6817 sched.cpp:730]Stopping framework '20140721-110017-16777343-5050-6678-0000'