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

Windows mounting /data/db #74

Closed
Sebastien-Meiffren opened this Issue Jan 10, 2016 · 11 comments

Comments

Projects
None yet
9 participants
@Sebastien-Meiffren

Sebastien-Meiffren commented Jan 10, 2016

Hi,

I'm trying to mount /data/db from my Windows dev PC but everytime I try, Mongo crashes as it seems to not have the right BUT :

  • I have changed the security parameters in windows to allow everyone to do everything (full access)
  • If I mount in a different directory, it works (the container launchs itself and I can write in my directory)

Here are the logs :

2016-01-10T17:35:20.729+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=8036f3a56506
2016-01-10T17:35:20.729+0000 I CONTROL  [initandlisten] db version v3.2.0
2016-01-10T17:35:20.729+0000 I CONTROL  [initandlisten] git version: 45d947729a0315accb6d4f15a6b06be6d9c19fe7
2016-01-10T17:35:20.729+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
2016-01-10T17:35:20.729+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2016-01-10T17:35:20.729+0000 I CONTROL  [initandlisten] modules: none
2016-01-10T17:35:20.729+0000 I CONTROL  [initandlisten] build environment:
2016-01-10T17:35:20.729+0000 I CONTROL  [initandlisten]     distmod: debian71
2016-01-10T17:35:20.729+0000 I CONTROL  [initandlisten]     distarch: x86_64
2016-01-10T17:35:20.729+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2016-01-10T17:35:20.729+0000 I CONTROL  [initandlisten] options: { storage: { engine: "wiredTiger" } }
2016-01-10T17:35:20.735+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enab led=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-01-10T17:35:20.741+0000 E STORAGE  [initandlisten] WiredTiger (1) [1452447320:741206][1:0x7f4dc3461c80], connection: /data/db/WiredTiger.wt: Operation not permitted
2016-01-10T17:35:20.742+0000 I -        [initandlisten] Assertion: 28595:1: Operation not permitted
2016-01-10T17:35:20.744+0000 I STORAGE  [initandlisten] exception in initAndListen: 28595 1: Operation not permitted, terminating
2016-01-10T17:35:20.744+0000 I CONTROL  [initandlisten] dbexit:  rc: 100

I have files that have been created in my directory but they seems locked in. I have to turn off the docker-machine to delete WiredTiger.wt

@zysam

This comment has been minimized.

zysam commented Jan 17, 2016

+1, it can run ,but don't mount

@yosifkit

This comment has been minimized.

Member

yosifkit commented Jan 18, 2016

Yeah I don't think it is possible to run mongodb using the shared folders of the virtual machine. You can still keep it persistent if you use -v /var/lib/boot2docker/my-mongodb-data/:/data/db/ which will store it on the VM hard disk.

@Sebastien-Meiffren

This comment has been minimized.

Sebastien-Meiffren commented Jan 25, 2016

That is unfortunate !
Any clues on why it is this way ?

@yosifkit

This comment has been minimized.

Member

yosifkit commented Jan 27, 2016

Found a link: VirtualBox Shared Folders are not supported by mongodb.

@mayerwin

This comment has been minimized.

mayerwin commented Jul 25, 2016

I am having this issue on the latest Docker for Windows beta, which uses Hyper-v (not Virtualbox):

mongodb    | 2016-07-25T10:04:35.286+0000 I CONTROL  [main] ** WARNING: --rest is specified without --httpinterface,
mongodb    | 2016-07-25T10:04:35.287+0000 I CONTROL  [main] **          enabling http interface
mongodb    | 2016-07-25T10:04:35.327+0000 I CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=b96365b4a2c3
mongodb    | 2016-07-25T10:04:35.328+0000 I CONTROL  [initandlisten] db version v3.3.9
mongodb    | 2016-07-25T10:04:35.328+0000 I CONTROL  [initandlisten] git version: 15d3d1f9bd151a2cd21fc7bee0bffc61caaaeb1d
mongodb    | 2016-07-25T10:04:35.328+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1t  3 May 2016
mongodb    | 2016-07-25T10:04:35.329+0000 I CONTROL  [initandlisten] allocator: tcmalloc
mongodb    | 2016-07-25T10:04:35.329+0000 I CONTROL  [initandlisten] modules: none
mongodb    | 2016-07-25T10:04:35.329+0000 I CONTROL  [initandlisten] build environment:
mongodb    | 2016-07-25T10:04:35.329+0000 I CONTROL  [initandlisten]     distmod: debian81
mongodb    | 2016-07-25T10:04:35.329+0000 I CONTROL  [initandlisten]     distarch: x86_64
mongodb    | 2016-07-25T10:04:35.329+0000 I CONTROL  [initandlisten]     target_arch: x86_64
mongodb    | 2016-07-25T10:04:35.330+0000 I CONTROL  [initandlisten] options: { net: { http: { RESTInterfaceEnabled: true, enabled: true } } }
mongodb    | 2016-07-25T10:04:35.354+0000 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=256M,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
mongodb    | 2016-07-25T10:04:35.460+0000 E STORAGE  [initandlisten] WiredTiger (17) [1469441075:460814][1:0x7fd5cf5c2cc0], connection: /data/db/WiredTiger.wt: handle-open: open: File exists
mongodb    | 2016-07-25T10:04:35.467+0000 I STORAGE  [initandlisten] WiredTiger unexpected file WiredTiger.wt found, renamed to WiredTiger.wt.3
mongodb    | 2016-07-25T10:04:35.475+0000 E STORAGE  [initandlisten] WiredTiger (1) [1469441075:475777][1:0x7fd5cf5c2cc0], connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
mongodb    | 2016-07-25T10:04:35.483+0000 I -        [initandlisten] Assertion: 28595:1: Operation not permitted
mongodb    | 2016-07-25T10:04:35.509+0000 I STORAGE  [initandlisten] exception in initAndListen: 28595 1: Operation not permitted, terminating
mongodb    | 2016-07-25T10:04:35.509+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
mongodb    | 2016-07-25T10:04:35.509+0000 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
mongodb    | 2016-07-25T10:04:35.509+0000 I NETWORK  [initandlisten] shutdown: going to flush diaglog...
mongodb    | 2016-07-25T10:04:35.509+0000 I CONTROL  [initandlisten] now exiting
mongodb    | 2016-07-25T10:04:35.510+0000 I CONTROL  [initandlisten] shutting down with code:100

Is this expected? I thought Hyper-v resolved all problems posed by Virtualbox.

@yosifkit

This comment has been minimized.

Member

yosifkit commented Jul 25, 2016

Docker for Windows does make much of the VM transparent to the Windows host, but it is still a virtual machine. I haven't tried using it with a mongo container, but I would guess that MongoDB needs something else supported by the file system. There is also this issue on the forums about volume mounts being extremely slow.

@ptitcoutu

This comment has been minimized.

ptitcoutu commented Aug 10, 2016

It works using a volume which is created using docker volume create --name=myvolume
The volume name is used instead of the local path. It's just a workaround.
To be more precise the line I used in my case :

docker volume create --name=mongodata
docker run -d -p 27017:27017 -v mongodata:/data/db --name=mymongo mongodb:3.3

@Oyelaking

This comment has been minimized.

Oyelaking commented Jul 27, 2017

Wow!!!

@ptitcoutu thanks a lot. Been battling with this for over a week.

@christianulson

This comment has been minimized.

christianulson commented Aug 2, 2017

on docker-machine i use this

conect to docker-machine
docker-machine ssh default

create a file
cd /

vi "/mnt/sda1/var/lib/boot2docker/bootlocal.sh"
inside of this file
mkdir -p <local_dir>
mount -t vboxsf -o defaults,uid=id -u docker,gid=id -g docker <mount_name> <local_dir>

exemple :

mkdir -p Projects
mount -t vboxsf -o defaults,uid=id -u docker,gid=id -g docker Projects Projects

Where Projects is the virtual box folder

To close and save the file:
:x

@cyclic-reference

This comment has been minimized.

cyclic-reference commented Dec 7, 2017

@ptitcoutu Thanks! For those using compose you can do this:

version: '3'
services:
  mongodb:
    image: mongo:latest
    volumes:
      - mongodata:/data/db
volumes:
  mongodata:
@lsytj0413

This comment has been minimized.

lsytj0413 commented Dec 19, 2017

same issue here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment