-
Notifications
You must be signed in to change notification settings - Fork 21
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
docker: Fix MongoDB container volume error #12
base: master
Are you sure you want to change the base?
Conversation
@@ -52,7 +52,6 @@ services: | |||
hostname: notesnook-db | |||
volumes: | |||
- dbdata:/data/db | |||
- dbdata:/data/configdb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mapped dbdata
to different directories /data/db
and /data/configdb
, The directory /data/configdb
is not necessary, so I deleted it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when /data/db
and /data/configdb
containing the same file, may it cause conflicts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Config db is required and used internally by MongoDB: https://www.mongodb.com/docs/manual/reference/config-database/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.mongodb.com/docs/manual/reference/program/mongod/#std-option-mongod.--configsvr
--configsvr
Required if starting a config server.
Declares that this mongod instance serves as the config server of a sharded cluster. When running with this option, clients (i.e. other cluster components) cannot write data to any database other than config and admin. The default port for a mongod with this option is 27019 and the default --dbpath directory is /data/configdb, unless specified.
The /data/configdb
directory is only used when the --configsvr
option is enabled In addition, there may be file conflicts when two different directories are mapped to one volume, so I deleted the second mapping. If you don't like this processing method, I can add configdb
volume to map to /data/configdb
No description provided.