servicecomb-kie icon indicating copy to clipboard operation
servicecomb-kie copied to clipboard

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

Open 96loveslife opened this issue 2 years ago • 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

96loveslife avatar May 12 '22 04:05 96loveslife

would you like to fix this problem?

tianxiaoliang avatar May 13 '22 11:05 tianxiaoliang

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

mniwjb avatar Mar 07 '24 08:03 mniwjb