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

docker: Fix MongoDB container volume error #12

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dyw770
Copy link
Contributor

@dyw770 dyw770 commented Oct 13, 2024

No description provided.

@@ -52,7 +52,6 @@ services:
hostname: notesnook-db
volumes:
- dbdata:/data/db
- dbdata:/data/configdb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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/

Copy link
Contributor Author

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

@dyw770 dyw770 requested a review from thecodrr October 28, 2024 01:36
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

Successfully merging this pull request may close these issues.

2 participants