mesosphere / marathon

Deploy and manage containers (including Docker) on top of Apache Mesos at scale.
https://mesosphere.github.io/marathon/
Apache License 2.0
4.07k stars 845 forks source link

Marathon can not post a event to the url which has already been registered (about `/v2/eventSubscriptions`) #1355

Closed hyper0x closed 9 years ago

hyper0x commented 9 years ago

I enabled Marathon callback system with --event_subscriber http_callback.

I run (Bomboo can cover it):

curl -H "Content-Type:application/json" -d "" "http://<marathon_ip>:<marathon_port>/v2/eventSubscriptions?callbackUrl=<bamboo_ip>:<bamboo_port>/api/marathon/event_callback"

And get the result:

{"clientIp":"<marathon_ip>","callbackUrl":"<bamboo_ip>:<bamboo_port>/api/marathon/event_callback","eventType":"subscribe_event","timestamp":"2015-04-01T07:24:17.592Z"}

Is that right?

But no any request has been received while I restart (or scale or new) the app in Marathon. On the other hand, I run follow command:

curl -d "{\"EventType\": \"fake event\"}" "http://<bamboo_ip>:<bamboo_port>/api/marathon/event_callback"

Then it seems everything is ok (Bomboo respond Got it!).

I guess that is a question of Marathon about configuration. Is that it?

hyper0x commented 9 years ago

My marathon's info is

{  
   "name":"marathon",
   "http_config":{  
      "assets_path":null,
      "http_port":8080,
      "https_port":8443
   },
   "frameworkId":"20150319-231746-33794240-5050-968-0000",
   "leader":"192.168.4.5:8080",
   "event_subscriber":{  
      "type":"http_callback",
      "http_endpoints":null
   },
   "marathon_config":{  
      "local_port_max":20000,
      "local_port_min":10000,
      "hostname":"192.168.4.5",
      "master":"zk://192.168.4.6:2181/my-marathon",
      "reconciliation_interval":300000,
      "mesos_role":null,
      "task_launch_timeout":300000,
      "reconciliation_initial_delay":15000,
      "ha":true,
      "failover_timeout":604800,
      "checkpoint":true,
      "webui_url":null,
      "executor":"//cmd",
      "marathon_store_timeout":2000,
      "mesos_user":"root"
   },
   "version":"0.8.1",
   "zookeeper_config":{  
      "zk_path":"/my-marathon",
      "zk":"zk://192.168.4.6:2181/my-marathon",
      "zk_timeout":10,
      "zk_hosts":"192.168.4.6:2181",
      "zk_future_timeout":{  
         "duration":10
      }
   },
   "elected":true
}

Why is this content?

 "event_subscriber":{  
      "type":"http_callback",
      "http_endpoints":null
   },

Is that right?

I send a GET request http://192.168.4.5:8080/v2/eventSubscriptions, and obtain a response:

{"callbackUrls":["http://192.168.4.7:8000/api/marathon/event_callback"]}
hyper0x commented 9 years ago

I resolved. The callback url is mistake.