Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesos Persistent Volumes problems #237

Closed
elan100cs opened this issue Dec 12, 2016 · 3 comments
Closed

Mesos Persistent Volumes problems #237

elan100cs opened this issue Dec 12, 2016 · 3 comments

Comments

@elan100cs
Copy link

elan100cs commented Dec 12, 2016

Hi there,

The mesos persistent volumes doesnt work eventhough i added in the marathon run params as instructed here https://mesosphere.github.io/marathon/docs/persistent-volumes.html.

The behavior that im seeing is the data either doesnt get persisted in the panteras container or it gets persisted in the panteras container but doesnt get persisted in the host drive.

After investigating this problems for a few days, i found the problem is due to the docker volume propagation are set to rprivate by default when panteras mapped the mesos work dir.

The rprivate propagation in the docker volume meant that a folder cannot be mounted twice. Since panteras itself is a docker container which mounted the /tmp/mesos workdir, therefore the mesos persistent volumes wont work, because it will also mount /tmp/mesos/volumes directory.

To fix this, we need to set the the propagation of the docker volume to 'shared'. This will allow the folder to be mounted twice within docker volume. You wont find this in the official docker documentation yet. As specified here, the documentation is missing moby/moby#20656

To be specific the fix would be to change the docker-compose.yml.tpl

volumes:
- "/etc/resolv.conf:/etc/resolv.conf.orig"
- "/var/spool/marathon/artifacts/store:/var/spool/store"
- "/var/run/docker.sock:/tmp/docker.sock"
- "/var/lib/docker:/var/lib/docker"
- "/sys:/sys"
- "/tmp/mesos:/tmp/mesos:shared"
- "/tmp/supervisord:/tmp/supervisord"
- "/tmp/consul/data:/opt/consul/data"
- "/proc:/host/proc:ro"
- "/sys:/host/sys:ro"

I am happy to create a pull request if you want me to.

@sielaq
Copy link
Contributor

sielaq commented Dec 13, 2016

Since we use mostly stateless appsin PaaS, we didn't notice that. Thanks a lot for info.
We can add this.

sielaq added a commit to sielaq/PanteraS that referenced this issue Dec 13, 2016
sielaq added a commit that referenced this issue Dec 13, 2016
@sielaq
Copy link
Contributor

sielaq commented Dec 13, 2016

I made it optional, you will have to do
export SHARED=:shared
I can't make it default since volume is not always shared mount (like in travis).

🤔 I should named it differently like MOUNT_OPT

@sielaq
Copy link
Contributor

sielaq commented Dec 13, 2016

just for history
#238

@sielaq sielaq closed this as completed Dec 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants