I have a mesos and chronos environment, I want to use chronos api to monitor jobs status, But ...
curl -L http://localhost:8080/leader
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 </title>
</head>
<body>
<h2>HTTP ERROR: 404</h2>
<p>Problem accessing /leader. Reason:
<pre> Not Found</pre></p>
<hr /><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.3.z-SNAPSHOT</a><hr/>
</body>
</html>
It return 404 to me,Can anybody has ideas? The other features work fine. The API URL is : chronos REST API DOC
You'll need to ensure you are connecting to the correct host on your cluster. It's likely chronos is not accessible via localhost or chronos-node given you are not receiving a response.
To determine where chronos is running, leverage mesos dns.
If your service is installed as
chronos
, look up the SRV record for all TCP endpoints as follows:In this case above, I installed via the DC/OS universe, which automatically deploys with any available port via the host network driver, however I see there is a tcp listener on port 9669 via the DNS query. From there you can receive a response via
curl -L -X GET http://chronos.marathon.mesos:9669/scheduler/jobs
. (note:, the chronos documentation states to prefix with/v1
, however in some deployments, that will not be the case).Lastly, you'll likely not want to perform a lookup of an SRV record every time. If you installed via the DC/OS universe, chronos is deployed via marathon, however the universe package hides all the configuration options necessary to define a VIP via the DC/OS interface. This can be addressed by manually going to the original marathon interface, where you'll be able to change the configuration (or via the marathon api).