0

I am sharing a linux box with some coworkers, all of them developing in the mesos ecosphere. The most convenient way to test a framework that I am hacking around with commonly is to run mesos-local.sh (combining both master and slaves in one).

That works great as long as none of my coworkers do the same. As soon as one of them did use that shortcut, no other can do that anymore as the master specific temp-files are stored in /tmp/mesos and the user that ran that instance of mesos will have the ownership of those files and folders. So when another user tries to do the same thing something like the following will happen when trying to run any task from a framework;

F0207 05:06:02.574882 20038 paths.hpp:344] CHECK_SOME(mkdir): Failed to create executor directory '/tmp/mesos/0/slaves/201402051726-3823062160-5050-31807-0/frameworks/201402070505-3823062160-5050-20015-0000/executors/default/runs/d46e7a7d-29a2-4f66-83c9-b5863e018fee'Permission denied

Unfortunately, mesos-local.sh does not offer a flag for overriding that path whereas mesos-master.sh does via --work_dir=VALUE.

Hence the obvious workaround is to not use mesos-local.sh but master and slave as separate instances. Not too convenient though...

Charles
  • 50,943
  • 13
  • 104
  • 142
Till
  • 27,559
  • 13
  • 88
  • 122

1 Answers1

0

The easiest workaround for preventing that problem, no matter if you run mesos-master.sh or mesos-local.sh is to patch the environment setup within bin/mesos-master-flags.sh.

That file is used by both, the mesos-master itself as well as mesos-local, hence it is the perfect place to override the work-directory.

Edit bin/mesos-master-flags.sh and add the following to it;

export MESOS_WORK_DIR=/tmp/mesos-"$USER"

Now run bin/mesos-local.sh and you should see something like this in the beginning of its log output;

I0207 05:36:58.791069 20214 state.cpp:33] Recovering state from '/tmp/mesos-tillt/0/meta'

By that all users that patched their mesos-master-flags.sh accordingly will have their personal work-dir setup and there is no more stepping on each others feet.

And if you prefer not to patch any files, you could just as well simply prepend the startup of that mesos instance by setting the environment variable manually:

MESOS_WORK_DIR=/tmp/mesos-foo bin/mesos-local.sh
Till
  • 27,559
  • 13
  • 88
  • 122