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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

networks:
- notesnook
command: --replSet rs0 --bind_ip_all
Expand Down