Name: marathon-cli
Owner: CiscoCloud
Description: A golang cli to manage apps and groups in Marathon
Created: 2015-02-13 16:11:19.0
Updated: 2017-02-07 18:48:59.0
Pushed: 2015-02-22 02:06:42.0
Homepage: null
Size: 256
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A golang cli to manage apps and groups in Marathon
ANDS:
nfo Gets information about the marathon cluster
eader Gets the current leader
mleader Forces current leader to abdicate
mapp Deletes an app
sapp List all apps or lists provided apps in the arguments
ing Test Marathon connection
elp, h Shows a list of commands or help for one command
AL OPTIONS:
-host "localhost:8080" Marathon host (default localhost:8080) [$MARATHON_HOST]
-format "json" Output format (json)
-help, -h show help
-version, -v print the version
rathon-cli --host host-01:8080 ping
[0000] Ping successful, recieved 'pong' from host-02:8080
rathon --host host-01:8080 info
Code": 200,
leader": "host-01:8080",
frameworkId": "20150212-005751-3034589101-5050-27381-0000",
http_config": {
"http_port": 8080,
"https_port": 8443
,
marathon_config": {
"checkpoint": true,
"executor": "//cmd",
"failover_timeout": 604800,
"ha": true,
"hostname": "host-01",
"local_port_min": 10000,
"local_port_max": 20000,
"master": "zk://zookeeper.service.consul:2181/mesos",
"mesos_role": "",
"mesos-user": "",
"reconciliation_initial_delay": 15000,
"reconciliation_interval": 300000,
"task_launch_timeout": 300000
,
name": "marathon",
version": "0.8.0",
zookeeper_config": {
"zk": "zk://zookeeper.service.consul:2181/marathon",
"zk_future_timeout": {
"duration": 10
},
"zk_hosts": "zookeeper.service.consul:2181",
"zk_path": "/marathon",
"zk_state": "",
"zk_timeout": 10
arathon-cli --host host-01:8080 leader
Code": 200,
leader": "host-02:8080"
rathon-cli --host host-01:8080 rmleader
Code": 200,
message": "Leadership abdicted"
After a leader steps down, Marathon will perform an election to determine the next leader. You can confirm that the leadership changed:
rathon-cli --host host-01:8080 leader
Code": 200,
leader": "host-01:8080"
Applications are identified by their “id” field.
To shorten the command line, we can set the MARATHON_HOST
environment variable:
rt MARATHON_HOST=host:8080
rathon-cli lsapp
Code": 200,
apps": [
{
"id": "/hello-rails",
"cmd": "cd hello \u0026\u0026 bundle install \u0026\u0026 bundle exec unicorn -p $PORT",
"cpus": 1,
"env": {
"RAILS_ENV": "production"
},
"instances": 1,
"mem": 100,
"ports": [
10001
],
.. <output omitted>
rathon-cli lsapp hello-rails
Code": 200,
app": {
"id": "/hello-rails",
"cmd": "cd hello \u0026\u0026 bundle install \u0026\u0026 bundle exec unicorn -p $PORT",
"cpus": 1,
"env": {
"RAILS_ENV": "production"
},
"instances": 1,
"mem": 100,
"ports": [
... <output omitted>
This will terminate and delete an application
rathon-cli rmapp hello-rails
[0000] Application deleted: hello-rails
Use a standard Marathon application configuration file to launch an application. The examples/
directory contains sample files.
rathon-cli app --file examples/rails.json
[0000] Application deployed app: hello-rails
Code": 201,
version": "2015-02-16T14:27:55.572Z"
Refer to the Marathon Documentation for more configuration examples.