Apache Mesos is an open source cluster manager developed at UC Berkeley. It provides resource isolation and sharing across distributed applications.
The figure shows the main components of Mesos. Mesos consists of a master daemon that manages slave daemons running on each cluster node. Mesos frameworks are applications that run on Mesos and run tasks on these slaves. Slaves are either physical or virtual machines, typically from the same provider.
Mesos uses a two-level scheduling mechanism where resource offers are made to frameworks. The Mesos master node decides how many resources to offer each framework, while each framework determines the resources it accepts and what application to execute on those resources.
Marathon is a container orchestration platform running on Mesos. Multiple container formats are supported and Docker is certainly the most common one!
This blog will show how to setup Mesos, Marathon, and run a simple Docker image. This setup is only for the brave of heart. I’m always interested in looking under the hood and that’s what motivated this post. But a future post will show a more seamless install.
Let’s get started!
Configure CentOS VM
Download CentOS and configure the VM as shown:
Install Components
Install the different components required for this setup.
- Configure Mesos repo:
1234567891011121314151617[arun@arun-centos ~]$ sudo rpm -Uvh http://repos.mesosphere.com/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpmWe trust you have received the usual lecture from the local SystemAdministrator. It usually boils down to these three things:#1) Respect the privacy of others.#2) Think before you type.#3) With great power comes great responsibility.[sudo] password for arun:Retrieving http://repos.mesosphere.com/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpmwarning: /var/tmp/rpm-tmp.9ssCDQ: Header V4 RSA/SHA1 Signature, key ID e56151bf: NOKEYPreparing... ################################# [100%]Updating / installing...1:mesosphere-el-repo-7-1 ################################# [100%] - Install Mesos and Marathon:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122[arun@arun-centos ~]$ sudo yum -y install mesos marathonLoaded plugins: fastestmirror, langpacksbase | 3.6 kB 00:00extras | 3.4 kB 00:00mesosphere | 2.9 kB 00:00mesosphere-noarch | 2.9 kB 00:00updates | 3.4 kB 00:00(1/6): base/7/x86_64/group_gz | 155 kB 00:00(2/6): extras/7/x86_64/primary_db | 117 kB 00:00(3/6): mesosphere-noarch/primary_db | 2.5 kB 00:00(4/6): mesosphere/x86_64/primary_db | 27 kB 00:00(5/6): base/7/x86_64/primary_db | 5.3 MB 00:01(6/6): updates/7/x86_64/primary_db | 4.1 MB 00:02Determining fastest mirrors* base: mirror.supremebytes.com* extras: centos.den.host-engine.com* updates: mirror.hmc.eduResolving Dependencies--> Running transaction check---> Package marathon.x86_64 0:1.1.1-1.0.472.el7 will be installed---> Package mesos.x86_64 0:0.28.1-2.0.20.centos701406 will be installed--> Processing Dependency: subversion for package: mesos-0.28.1-2.0.20.centos701406.x86_64--> Running transaction check---> Package subversion.x86_64 0:1.7.14-10.el7 will be installed--> Processing Dependency: subversion-libs(x86-64) = 1.7.14-10.el7 for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_wc-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_subr-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_repos-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_ra_svn-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_ra_neon-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_ra_local-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_ra-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_fs_util-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_fs_fs-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_fs_base-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_fs-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_diff-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_delta-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libsvn_client-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Processing Dependency: libapr-1.so.0()(64bit) for package: subversion-1.7.14-10.el7.x86_64--> Running transaction check---> Package apr.x86_64 0:1.4.8-3.el7 will be installed---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed---> Package subversion-libs.x86_64 0:1.7.14-10.el7 will be installed--> Finished Dependency ResolutionDependencies Resolved================================================================================Package Arch Version Repository Size================================================================================Installing:marathon x86_64 1.1.1-1.0.472.el7 mesosphere 64 Mmesos x86_64 0.28.1-2.0.20.centos701406 mesosphere 30 MInstalling for dependencies:apr x86_64 1.4.8-3.el7 base 103 kapr-util x86_64 1.5.2-6.el7 base 92 ksubversion x86_64 1.7.14-10.el7 base 1.0 Msubversion-libs x86_64 1.7.14-10.el7 base 921 kTransaction Summary================================================================================Install 2 Packages (+4 Dependent packages)Total download size: 96 MInstalled size: 168 MDownloading packages:warning: /var/cache/yum/x86_64/7/base/packages/apr-1.4.8-3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEYPublic key for apr-1.4.8-3.el7.x86_64.rpm is not installed(1/6): apr-1.4.8-3.el7.x86_64.rpm | 103 kB 00:00(2/6): apr-util-1.5.2-6.el7.x86_64.rpm | 92 kB 00:00(3/6): subversion-1.7.14-10.el7.x86_64.rpm | 1.0 MB 00:00(4/6): subversion-libs-1.7.14-10.el7.x86_64.rpm | 921 kB 00:00warning: /var/cache/yum/x86_64/7/mesosphere/packages/mesos-0.28.1-2.0.20.centos701406.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID e56151bf: NOKEYPublic key for mesos-0.28.1-2.0.20.centos701406.x86_64.rpm is not installed(5/6): mesos-0.28.1-2.0.20.centos701406.x86_64.rpm | 30 MB 00:29(6/6): marathon-1.1.1-1.0.472.el7.x86_64.rpm | 64 MB 00:36--------------------------------------------------------------------------------Total 2.6 MB/s | 96 MB 00:36Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7Importing GPG key 0xF4A80EB5:Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5Package : centos-release-7-2.1511.el7.centos.2.10.x86_64 (@anaconda)From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mesosphereImporting GPG key 0xE56151BF:Userid : "Mesosphere Archive Automatic Signing Key <support@mesosphere.io>"Fingerprint: 8102 6d00 04c4 4cf7 ef55 adf8 df7d 54cb e561 51bfPackage : mesosphere-el-repo-7-1.noarch (installed)From : /etc/pki/rpm-gpg/RPM-GPG-KEY-mesosphereRunning transaction checkRunning transaction testTransaction test succeededRunning transactionInstalling : apr-1.4.8-3.el7.x86_64 1/6Installing : apr-util-1.5.2-6.el7.x86_64 2/6Installing : subversion-libs-1.7.14-10.el7.x86_64 3/6Installing : subversion-1.7.14-10.el7.x86_64 4/6Installing : mesos-0.28.1-2.0.20.centos701406.x86_64 5/6Created symlink from /etc/systemd/system/multi-user.target.wants/mesos-master.service to /usr/lib/systemd/system/mesos-master.service.Created symlink from /etc/systemd/system/multi-user.target.wants/mesos-slave.service to /usr/lib/systemd/system/mesos-slave.service.Installing : marathon-1.1.1-1.0.472.el7.x86_64 6/6Created symlink from /etc/systemd/system/multi-user.target.wants/marathon.service to /usr/lib/systemd/system/marathon.service.Verifying : apr-1.4.8-3.el7.x86_64 1/6Verifying : subversion-1.7.14-10.el7.x86_64 2/6Verifying : apr-util-1.5.2-6.el7.x86_64 3/6Verifying : mesos-0.28.1-2.0.20.centos701406.x86_64 4/6Verifying : marathon-1.1.1-1.0.472.el7.x86_64 5/6Verifying : subversion-libs-1.7.14-10.el7.x86_64 6/6Installed:marathon.x86_64 0:1.1.1-1.0.472.el7 mesos.x86_64 0:0.28.1-2.0.20.centos701406Dependency Installed:apr.x86_64 0:1.4.8-3.el7 apr-util.x86_64 0:1.5.2-6.el7subversion.x86_64 0:1.7.14-10.el7 subversion-libs.x86_64 0:1.7.14-10.el7Complete! - Install ZooKeeper:
123456789101112131415161718192021222324252627282930313233343536373839404142[arun@arun-centos ~]$ sudo yum -y install mesosphere-zookeeper[sudo] password for arun:Loaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile* base: mirror.supremebytes.com* extras: centos.den.host-engine.com* updates: mirror.hmc.eduResolving Dependencies--> Running transaction check---> Package mesosphere-zookeeper.x86_64 0:3.4.6-0.1.20141204175332.centos7 will be installed--> Finished Dependency ResolutionDependencies Resolved==================================================================================================Package Arch Version Repository Size==================================================================================================Installing:mesosphere-zookeeper x86_64 3.4.6-0.1.20141204175332.centos7 mesosphere 2.8 MTransaction Summary==================================================================================================Install 1 PackageTotal download size: 2.8 MInstalled size: 3.5 MDownloading packages:mesosphere-zookeeper-3.4.6-0.1.20141204175332.centos7.x86_64.rpm | 2.8 MB 00:00:01Running transaction checkRunning transaction testTransaction test succeededRunning transactionInstalling : mesosphere-zookeeper-3.4.6-0.1.20141204175332.centos7.x86_64 1/1Created symlink from /etc/systemd/system/multi-user.target.wants/zookeeper.service to /usr/lib/systemd/system/zookeeper.service.Verifying : mesosphere-zookeeper-3.4.6-0.1.20141204175332.centos7.x86_64 1/1Installed:mesosphere-zookeeper.x86_64 0:3.4.6-0.1.20141204175332.centos7Complete! - Add Docker repo:
1234567891011121314151617[arun@arun-centos ~]$ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'[dockerrepo]name=Docker Repositorybaseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/enabled=1gpgcheck=1gpgkey=https://yum.dockerproject.org/gpgEOF[sudo] password for arun:[dockerrepo]name=Docker Repositorybaseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/enabled=1gpgcheck=1gpgkey=https://yum.dockerproject.org/gpg - Install Docker:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263[arun@localhost ~]$ sudo yum -y install docker-engineLoaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfile* base: mirror.scalabledns.com* extras: linux.mirrors.es.net* updates: mirrors.adams.netResolving Dependencies--> Running transaction check---> Package docker-engine.x86_64 0:1.11.1-1.el7.centos will be installed--> Processing Dependency: docker-engine-selinux >= 1.11.1-1.el7.centos for package: docker-engine-1.11.1-1.el7.centos.x86_64--> Running transaction check---> Package docker-engine-selinux.noarch 0:1.11.1-1.el7.centos will be installed--> Finished Dependency ResolutionDependencies Resolved====================================================================================================Package Arch Version Repository Size====================================================================================================Installing:docker-engine x86_64 1.11.1-1.el7.centos dockerrepo 13 MInstalling for dependencies:docker-engine-selinux noarch 1.11.1-1.el7.centos dockerrepo 28 kTransaction Summary====================================================================================================Install 1 Package (+1 Dependent package)Total download size: 13 MInstalled size: 54 MDownloading packages:warning: /var/cache/yum/x86_64/7/dockerrepo/packages/docker-engine-selinux-1.11.1-1.el7.centos.noarch.rpm: Header V4 RSA/SHA512 Signature, key ID 2c52609d: NOKEYPublic key for docker-engine-selinux-1.11.1-1.el7.centos.noarch.rpm is not installed(1/2): docker-engine-selinux-1.11.1-1.el7.centos.noarch.rpm | 28 kB 00:00:00(2/2): docker-engine-1.11.1-1.el7.centos.x86_64.rpm | 13 MB 00:00:02----------------------------------------------------------------------------------------------------Total 5.3 MB/s | 13 MB 00:00:02Retrieving key from https://yum.dockerproject.org/gpgImporting GPG key 0x2C52609D:Userid : "Docker Release Tool (releasedocker) <docker@docker.com>"Fingerprint: 5811 8e89 f3a9 1289 7c07 0adb f762 2157 2c52 609dFrom : https://yum.dockerproject.org/gpgRunning transaction checkRunning transaction testTransaction test succeededRunning transactionInstalling : docker-engine-selinux-1.11.1-1.el7.centos.noarch 1/2restorecon: lstat(/var/lib/docker) failed: No such file or directorywarning: %post(docker-engine-selinux-1.11.1-1.el7.centos.noarch) scriptlet failed, exit status 255Non-fatal POSTIN scriptlet failure in rpm package docker-engine-selinux-1.11.1-1.el7.centos.noarchInstalling : docker-engine-1.11.1-1.el7.centos.x86_64 2/2Verifying : docker-engine-1.11.1-1.el7.centos.x86_64 1/2Verifying : docker-engine-selinux-1.11.1-1.el7.centos.noarch 2/2Installed:docker-engine.x86_64 0:1.11.1-1.el7.centosDependency Installed:docker-engine-selinux.noarch 0:1.11.1-1.el7.centosComplete!
Configure Hostname/IP address Mapping
Edit /etc/hosts
and create hostname and IP address mapping. Find IP address using ifconfig
and choose the network interface enabled during CentOS installation.
Start Services
Start all the services
- Start Docker:
1234[arun@arun-centos ~]$ sudo service docker startRedirecting to /bin/systemctl start docker.service - Start ZooKeeper:
123sudo systemctl start zookeeper - Start Mesos master:
1234[arun@arun-centos ~]$ sudo service mesos-master startRedirecting to /bin/systemctl start mesos-master.service - Configure
mesos
anddocker
containerizers:
123sudo sh -c "echo 'docker,mesos' > /etc/mesos-slave/containerizers" - Start Mesos slave:
1234[arun@arun-centos ~]$ sudo service mesos-slave startRedirecting to /bin/systemctl start mesos-slave.service - Start Marathon:
1234[arun@arun-centos ~]$ sudo service marathon startRedirecting to /bin/systemctl start marathon.service - Check for services:Mesos UI: http://127.0.0.1:5050
Marathon UI: http://127.0.0.1:8080
Logs:tail -f /var/log/messages
123456789101112[arun@arun-centos log]$ ps aux | grep mesoroot 4511 0.1 0.7 3974136 58968 ? Ssl 19:54 0:04 java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /opt/mesosphere/zookeeper/bin/../build/classes:/opt/mesosphere/zookeeper/bin/../build/lib/*.jar:/opt/mesosphere/zookeeper/bin/../lib/slf4j-log4j12-1.6.1.jar:/opt/mesosphere/zookeeper/bin/../lib/slf4j-api-1.6.1.jar:/opt/mesosphere/zookeeper/bin/../lib/netty-3.7.0.Final.jar:/opt/mesosphere/zookeeper/bin/../lib/log4j-1.2.16.jar:/opt/mesosphere/zookeeper/bin/../lib/jline-0.9.94.jar:/opt/mesosphere/zookeeper/bin/../zookeeper-3.4.6.jar:/opt/mesosphere/zookeeper/bin/../src/java/lib/*.jar:/etc/zookeeper/conf: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /etc/zookeeper/conf/zoo.cfgroot 15786 0.0 0.2 754788 19596 ? Ssl 20:43 0:00 /usr/sbin/mesos-slave --master=zk://localhost:2181/mesos --log_dir=/var/log/mesosroot 15792 0.0 0.0 107892 624 ? S 20:43 0:00 logger -p user.info -t mesos-slave[15786]root 15793 0.0 0.0 107892 700 ? S 20:43 0:00 logger -p user.err -t mesos-slave[15786]root 15837 1.9 3.0 2818056 239208 ? Ssl 20:43 0:10 java -Djava.library.path=/usr/local/lib:/usr/lib:/usr/lib64 -Djava.util.logging.SimpleFormatter.format=%2$s%5$s%6$s%n -Xmx512m -cp /usr/bin/marathon mesosphere.marathon.Main --zk zk://localhost:2181/marathon --master zk://localhost:2181/mesosroot 15838 0.0 0.2 829028 22908 ? Ssl 20:43 0:00 /usr/sbin/mesos-master --zk=zk://localhost:2181/mesos --port=5050 --log_dir=/var/log/mesos --quorum=1 --work_dir=/var/lib/mesosroot 15863 0.0 0.0 107892 620 ? S 20:43 0:00 logger -p user.info -t mesos-master[15838]root 15864 0.0 0.0 107892 696 ? S 20:43 0:00 logger -p user.err -t mesos-master[15838]arun 16931 0.0 0.0 112644 952 pts/0 R+ 20:52 0:00 grep --color=auto meso - Check Mesos master:
123456789101112131415161718192021222324[arun@arun-centos ~]$ systemctl status mesos-master● mesos-master.service - Mesos MasterLoaded: loaded (/usr/lib/systemd/system/mesos-master.service; enabled; vendor preset: disabled)Active: active (running) since Wed 2016-05-04 19:42:24 EDT; 32min agoMain PID: 8499 (mesos-master)Memory: 14.6MCGroup: /system.slice/mesos-master.service├─8499 /usr/sbin/mesos-master --zk=zk://localhost:2181/mesos --port=5050 --log_dir=/va...├─8513 logger -p user.info -t mesos-master[8499]└─8514 logger -p user.err -t mesos-master[8499]May 04 20:14:41 arun-centos mesos-master[8514]: I0504 20:14:41.564679 8527 master.cpp:3104] Proc...May 04 20:14:41 arun-centos mesos-master[8514]: I0504 20:14:41.565058 8527 master.hpp:177] Ad...os)May 04 20:14:41 arun-centos mesos-master[8514]: I0504 20:14:41.565093 8527 master.cpp:3589] Laun...May 04 20:14:41 arun-centos mesos-master[8514]: I0504 20:14:41.577255 8527 master.cpp:4763] Stat...May 04 20:14:41 arun-centos mesos-master[8514]: I0504 20:14:41.577287 8527 master.cpp:4811] F...000May 04 20:14:41 arun-centos mesos-master[8514]: I0504 20:14:41.577325 8527 master.cpp:6421] U...ED)May 04 20:14:41 arun-centos mesos-master[8514]: I0504 20:14:41.587143 8527 master.cpp:3918] Proc...May 04 20:14:41 arun-centos mesos-master[8514]: I0504 20:14:41.587198 8527 master.cpp:6487] Remo...May 04 20:14:41 arun-centos mesos-master[8514]: I0504 20:14:41.726095 8527 master.cpp:5324] S...006May 04 20:14:41 arun-centos mesos-master[8514]: I0504 20:14:41.728080 8527 master.cpp:3641] P...006Hint: Some lines were ellipsized, use -l to show in full. - Check Mesos slave:
123456789101112131415161718192021222324[arun@arun-centos ~]$ systemctl status mesos-slave● mesos-slave.service - Mesos SlaveLoaded: loaded (/usr/lib/systemd/system/mesos-slave.service; enabled; vendor preset: disabled)Active: active (running) since Wed 2016-05-04 20:00:43 EDT; 12min agoMain PID: 9864 (mesos-slave)Memory: 57.5MCGroup: /system.slice/mesos-slave.service├─9864 /usr/sbin/mesos-slave --master=zk://localhost:2181/mesos --log_dir=/var/log/mes...├─9876 logger -p user.info -t mesos-slave[9864]└─9877 logger -p user.err -t mesos-slave[9864]May 04 20:13:26 arun-centos mesos-slave[9877]: I0504 20:13:26.283629 9887 status_update_manag...000May 04 20:13:26 arun-centos mesos-slave[9877]: I0504 20:13:26.289118 9887 slave.cpp:3990] Cle...000May 04 20:13:26 arun-centos mesos-slave[9877]: I0504 20:13:26.289422 9887 slave.cpp:4078] Cle...000May 04 20:13:26 arun-centos mesos-slave[9877]: I0504 20:13:26.289459 9887 gc.cpp:55] Scheduling ...May 04 20:13:26 arun-centos mesos-slave[9877]: I0504 20:13:26.289489 9887 gc.cpp:55] Scheduli...ureMay 04 20:13:26 arun-centos mesos-slave[9877]: I0504 20:13:26.289499 9887 gc.cpp:55] Scheduling ...May 04 20:13:26 arun-centos mesos-slave[9877]: I0504 20:13:26.289511 9887 gc.cpp:55] Scheduli...ureMay 04 20:13:26 arun-centos mesos-slave[9877]: I0504 20:13:26.289520 9887 gc.cpp:55] Scheduli...ureMay 04 20:13:26 arun-centos mesos-slave[9877]: I0504 20:13:26.289525 9887 gc.cpp:55] Scheduli...ureMay 04 20:13:26 arun-centos mesos-slave[9877]: I0504 20:13:26.289533 9887 status_update_manag...000Hint: Some lines were ellipsized, use -l to show in full. - Check ZooKeeper:
123456789101112131415[arun@arun-centos log]$ /opt/mesosphere/zookeeper/bin/zkCli.shConnecting to localhost:2181log4j:WARN No appenders could be found for logger (org.apache.zookeeper.ZooKeeper).log4j:WARN Please initialize the log4j system properly.log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.Welcome to ZooKeeper!JLine support is enabledWATCHER::WatchedEvent state:SyncConnected type:None path:null[zk: localhost:2181(CONNECTED) 0] ls /mesos[json.info_0000000001, log_replicas]
Deploy Docker application to Mesos
A simple Docker-based application is defined using the configuration file. Marathon runs on port 8080 and so the updated configuration file looks like:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
{
"id": "basic-3",
"cmd": "python3 -m http.server $PORT0",
"cpus": 0.5,
"mem": 32.0,
"container": {
"type": "DOCKER",
"docker": {
"image": "python:3",
"forcePullImage": true,
"network": "BRIDGE",
"portMappings": [
{ "containerPort": 0, "hostPort": 0 }
]
}
}
}
|
Deploy the application as:
1
2
3
|
curl -X POST http://127.0.0.1:8080/v2/apps -d @app.json -H "Content-type: application/json"
|
The application will take some time in order to download the image and then run the container. This setup is slightly sensitive and multiple runs of the application showed that the Docker image was not successfully downloaded all the times. In that case, the Docker image was manually downloaded using docker pull python:3
and then the application could be successfully deployed.
In our case, master and slave are running on the same machine, and so the list of Docker images and running containers can be easily seen:
1
2
3
4
5
6
7
8
|
[arun@localhost ~]$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
python 3 67b5207e5d3b 8 days ago 671.1 MB
[arun@localhost ~]$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2ee42b120537 python:3 "/bin/sh -c 'python3 " About an hour ago Up About an hour 0.0.0.0:31669->31669/tcp mesos-d03f6e61-063f-4cae-9c1b-3fc6d8384b3a-S0.b99d82f6-9bc1-4a6f-ae3b-53b7f5d06b95
|
The application is available at port 31669
and can be seen at http://127.0.0.1:31669 as:
Mesos UI (http://127.0.0.1:5050) shows:
Marathon UI (http://127.0.0.1:8080) shows:
As you can see, this is quite an involving setup. A future blog post will show how to use DC/OS and set this up more seamlessly.
Further reading …
- Mesos Marathon
- Ports in Mesos
- Mesos CLI
- Mesos – Under the Hood
Mesos slack channel is awesome! Particularly I learned a lot about Mesos from @jgarcia.mesosphere, @akaplan.mesosphere, @harpreet.mesosphere, @graham.mesosphere. Thanks guys, keep up on engaging with the community!
Enjoy!
Source: http://blog.couchbase.com/2016/may/docker-apache-mesos-marathon