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

Inconsistent script database name in Quick Start causes docker-compose service startup to fail #244

Open
96loveslife opened this issue May 12, 2022 · 2 comments

Comments

@96loveslife
Copy link

【Scenes】
According to the quick start document, use the docker-compose command to start the service, but the database authentication fails

【Reason】
db.js

  • mongodb init database name is servicecomb
  • db.js init database name is kie
 {
        user: "kie",
        pwd: "123",
        roles:[
            {
                role: "readWrite",
                db:   "kie"
            }
        ]
    }

[Error Log]
can not dial db:server returned error on SASL authentication step: Authentication failed

@tianxiaoliang
Copy link
Contributor

would you like to fix this problem?

@mniwjb
Copy link

mniwjb commented Mar 7, 2024

would you like to fix this problem?

As the author said, we can modify the mongodb database name from 'servicecomb' to 'kie', like this:
Before:
sudo docker run --name mongo -d
-e "MONGO_INITDB_DATABASE=servicecomb"
-e "MONGO_INITDB_ROOT_USERNAME=kie"
-e "MONGO_INITDB_ROOT_PASSWORD=123"
-p 27017:27017
-v ./deployments/db.js:/docker-entrypoint-initdb.d/db.js:ro
mongo:4.0

After:
sudo docker run --name mongo -d
-e "MONGO_INITDB_DATABASE=kie"
-e "MONGO_INITDB_ROOT_USERNAME=kie"
-e "MONGO_INITDB_ROOT_PASSWORD=123"
-p 27017:27017
-v ./deployments/db.js:/docker-entrypoint-initdb.d/db.js:ro
mongo:4.0

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

No branches or pull requests

3 participants