A MESOS installation
1 http://archive.apache.org/dist/mesos/1.0.0/ Download the installation package
mesos-1.0.0 .tar.gz
2 Download and install related dependencies through apt-get
Warm up before downloading
1 )apt-get clean
2 )apt-get update
3 )apt-get grade
4 )apt-get install apt-file
5 )apt-file update
The main purpose of apt-file is to locate the missing package through apt-file search during the compilation process. For example, when libz is missing, execute apt-file search libz to locate the source package of the relevant package. get to download the source package to get the missing package.
$ apt-get -y install build-essential python-dev python-boto libcurl4-nss-dev libsasl2-dev libsasl2-modules maven libapr1-dev libsvn-dev lib32z1 zlib1g zlib1g-dev
3 Configure maven
$ vi /etc/maven/setting.xml
Add native library
<localRepository>/usr/share/maven-repo</localRepository>
4 Compile mesos
$ tar -zxvf mesos-1.0.0 .tar.gz
$ cd mesos-1.0.0
$ mkdir build
$ cd build
$ ../configure
$ make (very long process, online say make -j N can speed up)
$ make install
5 Fill in the pit depending on the character, you can skip it if you have a good character
When running it is possible to report erro while loading shared libraries: libmisos-1.0.0.so: cannot open shared object file: No such file or directory
This is because libmisos-1.0.0.so has not been successfully associated with usr/lib of linux
$ ln -s /usr/local/lib/*.so /usr/lib
$ ldconfig
6 run mesos
$ cd /usr/local/sbin
Master:
$ mesos-master --ip = 10.92.7.10 --quorum = 1 --work_dir = / opt / mesos / mesos-1.0.0 --zk = zk: //10.108.68.140: 2181 / mesos, 10.108.68.140: 2182 / month, 10.108.68.140: 2183 / month --cluster = month-cluster --log_dir = / opt / month / month-1.0.0 / log --logging_level = ERROR
$ mesos-master --ip = 10.92.7.11 --quorum = 1 --work_dir = / usr / local / mesos-1.0.0 --zk = zk: //10.108.68.140: 2181 / mesos, 10.108.68.140: 2182 / month, 10.108.68.140: 2183 / month --cluster = month-cluster --log_dir = / opt / month / month-1.0.0 / log --logging_level = ERROR
$ mesos-master --ip = 10.92.7.12 --quorum = 1 --work_dir = / opt / mesos / mesos-1.0.0 --zk = zk: //10.108.68.140: 2181 / mesos, 10.108.68.140: 2182 / month, 10.108.68.140: 2183 / month --cluster = month-cluster --log_dir = / opt / month / month-1.0.0 / log --logging_level = ERROR
Slaves:
$ mesos-agent --ip = 10.92.21.68 --work_dir = / opt / mesos / mesos-1.0.0 --master = zk: //10.108.68.140: 2181 / mesos, 10.108.68.140: 2182 / mesos, 10.108 .68.140: 2183 / month --log_dir = / opt / month / month-1.0.0 / log --logging_level = ERROR --docker = / usr / bin / docker
$ mesos-master --ip = 10.92.7.9 --quorum = 1 --work_dir = / opt / mesos / mesos-1.0.0 --zk = zk: //10.108.68.140: 2181 / mesos, 10.108.68.140: 2182 / month, 10.108.68.140: 2183 / month --cluster = month-cluster --log_dir = / opt / month / month-1.0.0 / log --logging_level = ERROR
Two install marathon
1 Download the package http://downloads.mesosphere.com/marathon/v1.2.0/marathon-1.2.0.tgz
marathon-1.2.0.tgz
2 Unzip
$ tar -zxvf marathon-1.2.0.tgz
$ cd marathon-1.2.0
3 run
Running each on three mesos master nodes ( 10.92.7.10/11/12 )
$ ./bin/start --master zk: //10.108.68.140: 2181 / mesos, 10.108.68.140: 2182 / mesos, 10.108.68.140: 2183 / mesos --zk zk: //10.108.68.140: 2181 / marathon , 10.108.68.140: 2182 / marathon, 10.108.68.140: 2183 / marathon
Three start swarm
10.92.7.10:
$ docker swarm init --listen-addr 10.92.7.10:2375
docker swarm join-token manager
10.92.7.11:
$ docker swarm join \
--token SWMTKN-1-47sw4sahh155dh541ue3befx5bzhdav29ew3hzekmlsm17fzjr-57bvcosjnupcrl0jjlxfgd91r \
10.92.7.10:2375
10.92.7.12:
$ docker swarm join \
--token SWMTKN-1-47sw4sahh155dh541ue3befx5bzhdav29ew3hzekmlsm17fzjr-57bvcosjnupcrl0jjlxfgd91r \
10.92.7.10:2375
member node
10.92.21.68:
$ docker swarm join \
--token SWMTKN-1-47sw4sahh155dh541ue3befx5bzhdav29ew3hzekmlsm17fzjr-4jcyj0q8wb1u59tk34w9dil4e \
10.92.7.10:2375
10.92.7.9:
$ docker swarm join \
--token SWMTKN-1-47sw4sahh155dh541ue3befx5bzhdav29ew3hzekmlsm17fzjr-4jcyj0q8wb1u59tk34w9dil4e \
10.92.7.10:2375
Four start overlay
$ docker network create -d overlay overlay_net
Five configure the docker container on marathon and run
/webserver/nginxlua
Command
Unspecified
Constraints
Unspecified
Dependencies
Unspecified
Labels
Unspecified
Resource Roles
Unspecified
Container
{
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "10.92.21.160:5000/csmbp/nginx:latest",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 80,
"hostPort": 0,
"servicePort": 10000,
"protocol": "tcp",
"labels":{}
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
}
CPUs
1
Environment
Unspecified
Executor
Unspecified
Health Checks
[
{
"path": "/",
"protocol": "HTTP",
"portIndex": 0,
"gracePeriodSeconds": 300,
"intervalSeconds": 60,
"timeoutSeconds": 20,
"maxConsecutiveFailures": 3,
"ignoreHttp1xx":false
}
]
Instances
1
IP Address
Unspecified
Memory
128 MiB
Disk Space
0 MiB
Port Definitions
[
{
"port": 10000,
"protocol": "tcp",
"labels": {}
}
]
Backoff Factor
1.15
Backoff
1 seconds
Max Launch Delay
3600 seconds
URIs
Unspecified
User
Unspecified
Args
Unspecified
Version
2016-10-20T14:36:54.795Z
tomcat
/app/tomcat
Command
Unspecified
Constraints
Unspecified
Dependencies
Unspecified
Labels
Unspecified
Resource Roles
Unspecified
Container
{
"type": "DOCKER",
"volumes": [],
"docker": {
"image": "10.92.21.160:5000/csmbp/tomcat:8.0",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 8080,
"hostPort": 0,
"servicePort": 10002,
"protocol": "tcp",
"labels":{}
}
],
"privileged": false,
"parameters": [],
"forcePullImage": false
}
}
CPUs
2
Environment
Unspecified
Executor
Unspecified
Health Checks
[
{
"path": "/CSMBP/",
"protocol": "HTTP",
"portIndex": 0,
"gracePeriodSeconds": 500,
"intervalSeconds": 500,
"timeoutSeconds": 300,
"maxConsecutiveFailures": 3,
"ignoreHttp1xx":false
}
]
Instances
1
IP Address
Unspecified
Memory
4096 MiB
Disk Space
0 MiB
Port Definitions
[
{
"port": 10002,
"protocol": "tcp",
"labels": {}
}
]
Backoff Factor
1.15
Backoff
1 seconds
Max Launch Delay
3600 seconds
URIs
Unspecified
User
Unspecified
Args
Unspecified
Version
2016-10-20T17:30:06.459Z
The tomcat health check time should be set longer than the garbage collection time