-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Primary node slow to start #68147
Comments
You can add the |
Sure thing. $ docker run -it -e MONGODB_ROOT_PASSWORD=password-123 -e MONGODB_REPLICA_SET_MODE=primary -e MONGODB_REPLICA_SET_KEY=replicasetkey123 -e BITNAMI_DEBUG=true -p 27017:27017 bitnami/mongodb:latest
mongodb 09:31:45.22 INFO ==>
mongodb 09:31:45.22 INFO ==> Welcome to the Bitnami mongodb container
mongodb 09:31:45.22 INFO ==> Subscribe to project updates by watching https://github.com/bitnami/containers
mongodb 09:31:45.22 INFO ==> Submit issues and feature requests at https://github.com/bitnami/containers/issues
mongodb 09:31:45.22 INFO ==> Upgrade to Tanzu Application Catalog for production environments to access custom-configured and pre-packaged software components. Gain enhanced features, including Software Bill of Materials (SBOM), CVE scan result reports, and VEX documents. To learn more, visit https://bitnami.com/enterprise
mongodb 09:31:45.22 INFO ==>
mongodb 09:31:45.22 DEBUG ==> Copying files from /opt/bitnami/mongodb/conf.default to /opt/bitnami/mongodb/conf
mongodb 09:31:45.23 INFO ==> ** Starting MongoDB setup **
mongodb 09:31:45.24 INFO ==> Validating settings in MONGODB_* env vars...
mongodb 09:31:45.44 INFO ==> Initializing MongoDB...
mongodb 09:31:45.48 INFO ==> Writing keyfile for replica set authentication...
mongodb 09:31:45.49 INFO ==> Deploying MongoDB from scratch...
mongodb 09:31:45.49 DEBUG ==> Starting MongoDB in background...
{"t":{"$date":"2024-07-02T09:31:45.513Z"},"s":"I", "c":"CONTROL", "id":5760901, "ctx":"main","msg":"Applied --setParameter options","attr":{"serverParameters":{"enableLocalhostAuthBypass":{"default":true,"value":true}}}}
about to fork child process, waiting until server is ready for connections.
forked process: 55
child process started successfully, parent exiting
MongoNetworkError: connect ECONNREFUSED 172.17.0.2:27017
mongodb 09:31:45.93 INFO ==> Creating users...
mongodb 09:31:45.93 INFO ==> Creating root user...
Current Mongosh Log ID: 6683c902f5a1058988597192
Connecting to: mongodb://127.0.0.1:27017/?directConnection=true&serverSelectionTimeoutMS=2000&tlsAllowInvalidHostnames=true&appName=mongosh+2.2.9
Using MongoDB: 7.0.11
Using Mongosh: 2.2.9
For mongosh info see: https://docs.mongodb.com/mongodb-shell/
To help improve our products, anonymous usage data is collected and sent to MongoDB periodically (https://www.mongodb.com/legal/privacy-policy).
You can opt-out by running the disableTelemetry() command.
test> db.getSiblingDB('admin').createUser({ user: 'root', pwd: 'password-123', roles: [{role: 'root', db: 'admin'}] })
{ ok: 1 }
test> mongodb 09:32:06.20 INFO ==> Users created
mongodb 09:32:06.21 INFO ==> Enabling authentication...
mongodb 09:32:06.23 INFO ==> Configuring MongoDB replica set...
mongodb 09:32:06.23 INFO ==> Stopping MongoDB...
mongodb 09:32:07.24 DEBUG ==> Starting MongoDB in background... |
According to that, it's taking just ~20 seconds to start:
|
And 20 second is not unacceptable by your standards? |
I think 20 seconds is acceptable to deploy the MongoDB container, having said that, if you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here. Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance. |
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback. |
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary. |
Name and Version
bitnami/mongodb:7.0.11
What architecture are you using?
amd64
What steps will reproduce the bug?
The container I'm using for test purposes takes almost a minute to start:
$ docker run -it -e MONGODB_ROOT_PASSWORD=password-123 -e MONGODB_REPLICA_SET_MODE=primary -e MONGODB_REPLICA_SET_KEY=replicasetkey123 -p 27017:27017 bitnami/mongodb:latest
What is the expected behavior?
The database to become available on port 27017 within a few seconds.
What do you see instead?
What is it doing there and how do I make it faster?
The text was updated successfully, but these errors were encountered: