Comments (17)
@ptitcoutu Thanks! For those using compose you can do this:
version: '3'
services:
mongodb:
image: mongo:latest
volumes:
- mongodata:/data/db
volumes:
mongodata:
from mongo.
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
from mongo.
I am running a local kubernetes cluster via Docker for Windows option. It there a way to get mongo working that way with a persistant storage?
from mongo.
Found a link: VirtualBox Shared Folders are not supported by mongodb.
from mongo.
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.
from mongo.
Sames issue. Will try mounted volume but this should not be needed really
from mongo.
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.
from mongo.
@davesmits were you able to get mongo working with your local kubernetes cluster? I've got the exact same scenario and just came upon this post...
from mongo.
+1, it can run ,but don't mount
from mongo.
That is unfortunate !
Any clues on why it is this way ?
from mongo.
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.
from mongo.
Wow!!!
@ptitcoutu thanks a lot. Been battling with this for over a week.
from mongo.
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
from mongo.
same issue here.
from mongo.
We solved it by using a volume inside the virtual machine
from mongo.
I used relative path ./mongodb_node
rather than C:/Users/myuser/mongodb_node
added some data than restarted container. Data still there. But when I used fully path data was wiped out.
from mongo.
Have same problem. Is there any solution for that on do let for windows?
from mongo.
Related Issues (20)
- Considering updating the documentation to state that the default configuration of this container is insecure HOT 6
- PGP KEYS expired for Mongodb v3.6 HOT 2
- CVE-2023-29403 HOT 3
- Add an example to documentation for "Initializing a fresh instance" HOT 1
- docker run mongo failed
- Mongo 6.0+ Fails to Run Using WSL HOT 6
- Is it possible Docker without WSL?
- Need help with CVE-2023-24538, CVE-2023-24540, CVE-2024-21626 and CVE-2023-27561 HOT 4
- Not connecting in the mongodb compass - getaddrinfo ENOTFOUND db-mongo-node17 HOT 6
- Mongo container sends network requests to mysterious EC2 servers at AWS HOT 9
- MongoDB container not always initialising after clearing volumes HOT 1
- 7.0.7 tag is missing linux/arm64 image HOT 1
- mongod:6.0.13 - Failed during mongod binary build in docker image.
- docker PIDS keeps increasing at 7.0.8 HOT 1
- Can't connect apps to MongoDB inside docker in Linux HOT 2
- `ENTRYPOINT` documentation HOT 1
- The docker container is throwing connection error if host machine is also running a mongodb on port 27017.
- Docker encountered an exited while in use
- mongo in the container does not properly listen on IPv6
- custom mongod.conf file append to docker mongo it restarts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongo.