marathon 1.6.322html
官方:https://mesosphere.github.io/marathon/node
Marathon is a production-grade container orchestration platform for Mesosphere’s Datacenter Operating System (DC/OS) and Apache Mesos.\git
marathon是一個DC/OS和mesos上的容器編排平臺;github
特色:高可用、支持多種容器運行時環境、支持狀態應用、UI、支持部署限制、服務發現&負載均衡、健康檢查、事件訂閱、日誌收集、REST API;json
Running on DC/OS, Marathon gains the following additional features:api
在DC/OS上還提供虛ip和認證;app
$ curl -O https://downloads.mesosphere.com/marathon/releases/1.6.322/marathon-1.6.322-2bf46b341.tgz
$ tar xzf marathon-1.6.322-2bf46b341.tgz
$ cd marathon-1.6.322-2bf46b341
$ ls bin
backup backup.bat marathon marathon.bat restore restore.bat負載均衡
啓動curl
$ ./bin/mathon --master zk://$zk1:2181,$zk2:2181/mesos --zk zk://$zk1:2181,$zk2:2181/marathon --http_port 8090lua
默認的8080很容易衝突
# rpm -ivh http://repos.mesosphere.com/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
# yum install marathon
# rpm -ivh http://repos.mesosphere.com/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
# yum install --downloadonly --downloaddir=/path/to/rpm/marathon marathon
# ls -l /path/to/rpm/marathon
total 75276
-rw-r--r-- 1 root root 77071702 Jan 29 07:41 marathon-1.7.189-0.1.20190125223314.el7.noarch.rpm# rpm -ivh marathon-1.7.189-0.1.20190125223314.el7.noarch.rpm
安裝目錄
# ls /usr/share/marathon/bin
backup backup.bat marathon marathon.bat restore restore.bat
修改配置
# vi /etc/default/marathon
MARATHON_MASTER=zk://$zk1:2181,$zk2:2181/mesos
MARATHON_ZK=zk://$zk1:2181,$zk2:2181/marathon
MARATHON_HTTP_PORT=8090
啓動
# service marathon start
or
# systemctl start marathon
開機啓動
# systemctl enable marathon
查看狀態
# service marathon status
or
# systemctl status marathon
若是有報錯查看日誌
# journalctl -u marathon -r
訪問 http://$marathon_server:8090
$ curl http://$marathon_server:8090/v2/apps
添加app
# curl -X POST http://$marathon_ip:8080/v2/apps -d@/path/to/app.json -H 'Content-type:application/json'
查看app
# curl http://$marathon_ip:8080/v2/apps/$app_id
刪除app
# curl -X DELETE http://$marathon_ip:8080/v2/apps/$app_id
重啓app
# curl -XPOST http://$marathon_ip:8080/v2/apps/$app_id/restart
具體參考:http://mesosphere.github.io/marathon/api-console/index.html
參考:https://mesosphere.github.io/marathon/docs/