mesosphere-backup / hdfs-deprecated

[DEPRECATED] This project is deprecated. It will be archived on December 1, 2017.
Apache License 2.0
147 stars 52 forks source link

shutdown api has been changed on mesos 0.24.1 #243

Open asdfsx opened 8 years ago

asdfsx commented 8 years ago

Mesos 0.24.0 added experimental support for v1 Scheduler HTTP API. and I cannot shutdown the framwork by using the following command:

curl -d "frameworkId=YOUR_FRAMEWORK_ID" -X POST http://YOUR_MESOS_URL:5050/master/shutdown

Now I use the following cmd to shutdown the framework

curl -X POST -H "Content-Type: application/json" http://YOUR_MESOS_URL:5050/api/v1/scheduler -d@teardown.json

Content of the teardown.json:

{
  "framework_id"    : {"value" : "framework id"},
  "type"            : "TEARDOWN"
} 
christobill commented 8 years ago

This also works:

curl -d 'frameworkId=YOUR_FRAMEWORK_ID' -X POST http://YOUR_MESOS_URL:5050/master/teardown 
asdfsx commented 8 years ago

@christobill maybe I got something wrong before -_- ,I'll close this issue!

asdfsx commented 8 years ago

@christobill I found if I boot up the hdfs by docker, I can not stop it ~~I'm confused by this

docker run -it --rm -v "$PWD"/hdfs-mesos-0.1.5:/hdfs-mesos-0.1.5 --net host --workdir /hdfs-mesos-0.1.5 mesos_jdk:0.24.1_1.7 bin/hdfs-mesos  

mesos_jdk is a image I build for execute hdfs-mesos, Dockerfile as follow

FROM centos:7

RUN rpm -i http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm && \
yum -y install mesos-0.24.1
RUN yum -y install java-1.7.0-openjdk
RUN yum -y install which
christobill commented 8 years ago

@asdfsx what I meant is: you are absolutely right, doc/README.md is not up-to-date. You should reopen the issue.

christobill commented 8 years ago

README.md should be changed like this:

2 Shutdown the hdfs framework in Mesos: curl -d "frameworkId=YOUR_FRAMEWORK_ID" -X POST http://YOUR_MESOS_URL:5050/master/teardown (or curl -d "frameworkId=YOUR_FRAMEWORK_ID" -X POST http://YOUR_MESOS_URL:5050/master/shutdown for mesos<0.24.1)

christobill commented 8 years ago

@asdfsx concerning your docker issue. Stop the docker container. Get the framework id in mesos UI. curl -d "frameworkId=YOUR_FRAMEWORK_ID" -X POST http://YOUR_MESOS_URL:5050/master/teardown (or curl -d "frameworkId=YOUR_FRAMEWORK_ID" -X POST http://YOUR_MESOS_URL:5050/master/shutdown for mesos<0.24.1) With zkCli, rmr /hdfs-mesos

I am just quoting the doc (appart from the shutdown/teardown change)

asdfsx commented 8 years ago

@christobill I guess this depends on the situation. If you have succescfully started the frame work, you can use the old style to shutdown the framework. If you failed to start the framework, you should use "teardown" to kill all the executors. "teardown" always work, no matter whether the framework was started successfuly.