---------- Forwarded message --------- From: Kevin Klues <klue...@gmail.com> Date: Sun, May 21, 2017 at 9:14 AM Subject: Re: question ablout "Attach/Exec Support in Mesos" To: 唐亮 <tangliang...@360.cn>
Hi Tangliang, Unfortunately we only have support for `task exec` in the DC/OS CLI at the moment. We have been planning to backport it to the Mesos CLI for some time, but haven't managed to do so yet. To complicate things, DC/OS used to allow running against standalone mesos, but the latest release of the DC/OS CLI doesn't support this anymore. Version 0.4.16 is the only release that supports *both* standalone mesos and `task exec` (https://github.com/dcos/dcos-cli/releases/tag/0.4.16). However, version 0.4.16 had a bug which didn't allow `task exec` to work with pods (it works with all other containers launched by the universal containerizer, just not pods). A fix for this has been committed upstream and is included in the latest DC/OS CLI, but that version of the CLI doesn't support running against standalone mesos anymore. Bummer.... Ideally, we would just backport `task exec` support into the mesos CLI and not have to worry about this. However, since this hasn't been done yet, I've decided to create a (non-release) version of the DC/OS CLI which can be used against standalone mesos and supports `task exec` for both normal containers and pods. Below are links to both Mac and Linux binaries for this version of the CLI: Mac: https://drive.google.com/open?id=0B4qvtaqAh24VVWVIY1RkR2ZMS1U Linux: https://drive.google.com/open?id=0B4qvtaqAh24Vd2JtMTZuUFJSUjg To use this version of the DC/OS CLI with standalone mesos, you first need to set core.dcos_url to a dummy value and then set core.mesos_master_url to the URL for your mesos master. $ dcos config set core.dcos_url "" $ dcos config set core.mesos_master_url <url> The format of the mesos_master_url is: "mesos_master_url": { "description": "Mesos master URL. Must be set in format: \"http://host:port\"", "format": "uri", "title": "Mesos Master URL", "type": "string" } I'm not sure how many of the commands in the DC/OS CLI work in a standalone mesos cluster, but I've tested at least the following with the binaries attached to this email and they seem to work just fine: $ dcos task NAME HOST USER STATE ID gpu-test core-dev root R gpu-test $ dcos task exec -it gpu-test bash [root@core-dev /]# exit $ dcos task log gpu-test Executing pre-exec command '{"arguments":["mesos-containerizer","mount","--help=false","--operation=make-rslave","--path=\/"],"shell":false,"value":"\/home\/klueska\/projects\/mesos\/build\/src\/mesos-containerizer"}' Received SUBSCRIBED event Subscribed executor on core-dev Received LAUNCH event Starting task gpu-test ... Hopefully we will find the time soon to backport all of this to the mesos CLI, so you won't have to do this awkward dance just to use `task exec`. Let me know if you have any other questions. Thanks! Kevin >