Reputation: 339
I have a local mesos setup (playa mesos) which is running in my local system. I have a requirement where i need to analyse the resource offering from different slaves and also need to get scheduling information from mesos cluster nodes (master and slaves).
I am trying to using curl for hitting the HTTP endpoints as mentioned in the mesos documentation and try to get the information back.
curl --no-buffer -X POST -H "Content-Type: application/json" --data '{"type":"SUBSCRIBE","subscribe":{"framework_info":{"user":"root","name":"democurl"}}}' http://<ip address>:5050/master/api/v1/scheduler
which is returning the offerings from different slaves. Now there are many HTTP endpoints related to scheduling, job execution etc which are not working. When I am trying to access them with curl it's simply not working and not returning any json data back.
I need help to make mesos http end points woking for all available resurces. I am trying to follow mesos documentation but no luck yet.It will be great if some one can post a sample curl command working. thanks
Upvotes: 0
Views: 1489
Reputation: 451
I believe your curl command hitting the "/health" endpoint is working fine; you see nothing at the command-line because the 200 OK response has no body. To see the response headers as well, use the -i
option with curl:
~/src/mesos/build|master⚡ curl -i --header "Content-Type: application/json" --header "Accept: application/json" -X GET localhost:5050/master/health
HTTP/1.1 200 OK
Date: Wed, 30 Mar 2016 19:15:45 GMT
Content-Length: 0
~/src/mesos/build|master⚡ curl -i --header "Content-Type: application/json" --header "Accept: application/json" -X GET localhost:5050/master/state
HTTP/1.1 200 OK
Date: Wed, 30 Mar 2016 19:16:54 GMT
Content-Type: application/json
Content-Length: 1504
{"version":"0.29.0","git_sha":"3b8ddc87e6fb7fe3c02147f30d9bacbc9d17bb14","git_branch":"refs\/heads\/master","build_date":"2016-03-28 13:59:44","build_time":1459198784.0,"build_user":"user","start_time":1459365180.7711,"elected_time":1459365180.78308,"id":"ed84d3b1-4153-4177-b96b-8a11be5d4959","pid":"[email protected]:5050","hostname":"localhost","activated_slaves":0.0,"deactivated_slaves":0.0,"leader":"[email protected]:5050","flags":{"allocation_interval":"1secs","allocator":"HierarchicalDRF","authenticate":"false","authenticate_http":"false","authenticate_slaves":"false","authenticators":"crammd5","authorizers":"local","framework_sorter":"drf","help":"false","hostname_lookup":"true","http_authenticators":"basic","initialize_driver_logging":"true","ip":"127.0.0.1","log_auto_initialize":"true","logbufsecs":"0","logging_level":"INFO","max_completed_frameworks":"50","max_completed_tasks_per_framework":"1000","max_slave_ping_timeouts":"5","port":"5050","quiet":"false","recovery_slave_removal_limit":"100%","registry":"replicated_log","registry_fetch_timeout":"1mins","registry_store_timeout":"20secs","registry_strict":"false","root_submissions":"true","slave_ping_timeout":"15secs","slave_reregister_timeout":"10mins","user_sorter":"drf","version":"false","webui_dir":"\/Users\/gmann\/src\/mesos\/build\/..\/src\/webui","work_dir":"\/Users\/gmann\/var\/mesos","zk_session_timeout":"10secs"},"slaves":[],"frameworks":[],"completed_frameworks":[],"orphan_tasks":[],"unregistered_frameworks":[]}%
Upvotes: 2