Inconsistent script database name in Quick Start causes docker-compose service startup to fail
96loveslife opened this issue · 2 comments
【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
would you like to fix this problem?
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