-
Notifications
You must be signed in to change notification settings - Fork 303
Description
I'm trying to start mongo using volume to persist the data between restarts.
I been in Docker Settings and check the C: checkbox and enter credentials.
when I start mongo db using this command line :
$ docker run -p 27017:27017 -v c:/test-mongo:/data/db mongo
I obtain the error below
2016-10-10T19:48:32.036+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=b08b1c94b8b2
2016-10-10T19:48:32.036+0000 I CONTROL [initandlisten] db version v3.2.10
2016-10-10T19:48:32.036+0000 I CONTROL [initandlisten] git version: 79d9b3ab5ce20f51c272b4411202710a082d0317
2016-10-10T19:48:32.036+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1t 3 May 2016
2016-10-10T19:48:32.036+0000 I CONTROL [initandlisten] allocator: tcmalloc
2016-10-10T19:48:32.036+0000 I CONTROL [initandlisten] modules: none
2016-10-10T19:48:32.036+0000 I CONTROL [initandlisten] build environment:
2016-10-10T19:48:32.036+0000 I CONTROL [initandlisten] distmod: debian81
2016-10-10T19:48:32.036+0000 I CONTROL [initandlisten] distarch: x86_64
2016-10-10T19:48:32.037+0000 I CONTROL [initandlisten] target_arch: x86_64
2016-10-10T19:48:32.037+0000 I CONTROL [initandlisten] options: {}
2016-10-10T19:48:32.048+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,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),
2016-10-10T19:48:32.063+0000 E STORAGE [initandlisten] WiredTiger (1) [1476128912:63941][1:0x7f7cbb986cc0], connection: /data/db/WiredTiger.wt: handle-open: open: Operation not permitted
2016-10-10T19:48:32.065+0000 I - [initandlisten] Assertion: 28595:1: Operation not permitted
2016-10-10T19:48:32.066+0000 I STORAGE [initandlisten] exception in initAndListen: 28595 1: Operation not permitted, terminating
2016-10-10T19:48:32.066+0000 I CONTROL [initandlisten] dbexit: rc: 100
if I check in teh HD, I'll see that some file were created
2016-10-10 03:48 PM
2016-10-10 03:48 PM ..
2016-10-10 03:48 PM journal
2016-10-10 03:48 PM 0 mongod.lock
2016-10-10 03:48 PM 46 WiredTiger
2016-10-10 03:48 PM 21 WiredTiger.lock
2016-10-10 03:48 PM 0 WiredTiger.wt
4 File(s) 67 bytes
BUT
if I use this command line :
docker volume create --name=mongodata
docker run -d -p 27017:27017 -v mongodata:/data/db mongo
it will works
$ docker run -p 27017:27017 -v mongodata:/data/db mongo
2016-10-10T19:54:39.093+0000 I CONTROL [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=01d5334620b9
2016-10-10T19:54:39.093+0000 I CONTROL [initandlisten] db version v3.2.10
2016-10-10T19:54:39.093+0000 I CONTROL [initandlisten] git version: 79d9b3ab5ce20f51c272b4411202710a082d0317
2016-10-10T19:54:39.093+0000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1t 3 May 2016
2016-10-10T19:54:39.093+0000 I CONTROL [initandlisten] allocator: tcmalloc
2016-10-10T19:54:39.093+0000 I CONTROL [initandlisten] modules: none
2016-10-10T19:54:39.093+0000 I CONTROL [initandlisten] build environment:
2016-10-10T19:54:39.093+0000 I CONTROL [initandlisten] distmod: debian81
2016-10-10T19:54:39.093+0000 I CONTROL [initandlisten] distarch: x86_64
2016-10-10T19:54:39.093+0000 I CONTROL [initandlisten] target_arch: x86_64
2016-10-10T19:54:39.093+0000 I CONTROL [initandlisten] options: {}
2016-10-10T19:54:39.098+0000 I - [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2016-10-10T19:54:39.098+0000 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=1G,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),
2016-10-10T19:54:39.306+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
2016-10-10T19:54:39.306+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
2016-10-10T19:54:39.306+0000 I NETWORK [initandlisten] waiting for connections on port 27017