oe-cloud icon indicating copy to clipboard operation
oe-cloud copied to clipboard

Connect to MongoDB atlas

Open prasgema opened this issue 7 years ago • 2 comments

Hi! I'm currently experimenting oeCloud for our internal operation to completely replace existing workflow application.

Currently we're stuck in how to connect our database to cloud-based MongoDB atlas under 2 reasons:

  1. It seemed that oecloud needs the database user as an admin, which is not really applicable in production environment. I'd like to know if there's manual override to this.
  2. I keep getting this Connection fails: { MongoError: no SNI name sent, make sure using a MongoDB 3.4+ driver/shell.name: 'MongoError', message: 'no SNI name sent, make sure using a MongoDB 3.4+ driver/shell.', ok: 0, errmsg: 'no SNI name sent, make sure using a MongoDB 3.4+ driver/shell.', code: 8000, codeName: 'AtlasError' } This is my datasource.json file:
{
  "db": {
    "host": "vti-oecloud-test-shard-00-00-qoacp.mongodb.net",
    "port": 27017,
    "url": "mongodb://vti-oecloud-test-shard-00-00-qoacp.mongodb.net:27017,vti-oecloud-test-shard-00-01-qoacp.mongodb.net:27017,vti-oecloud-test-shard-00-02-qoacp.mongodb.net:27017/test?ssl=true&replicaSet=vti-oecloud-test-shard-0&authSource=admin&retryWrites=true",
    "database": "atlas-db",
    "user": "<username>",
    "password": "<password>",
    "name": "db",
    "connector": "mongodb"
  },
  "appdb": {
    "host": "vti-oecloud-test-shard-00-00-qoacp.mongodb.net",
    "port": 27017,
    "url": "mongodb://vti-oecloud-test-shard-00-00-qoacp.mongodb.net:27017,vti-oecloud-test-shard-00-01-qoacp.mongodb.net:27017,vti-oecloud-test-shard-00-02-qoacp.mongodb.net:27017/test?ssl=true&replicaSet=vti-oecloud-test-shard-0&authSource=admin&retryWrites=true",
    "database": "atlas-appdb",
    "user": "<username>",
    "password": "<password>",
    "name": "appdb",
    "connector": "mongodb"
  },
  "gridfs_db": {
    "host": "vti-oecloud-test-shard-00-00-qoacp.mongodb.net",
    "port": 27017,
    "url": "mongodb://vti-oecloud-test-shard-00-00-qoacp.mongodb.net:27017,vti-oecloud-test-shard-00-01-qoacp.mongodb.net:27017,vti-oecloud-test-shard-00-02-qoacp.mongodb.net:27017/test?ssl=true&replicaSet=vti-oecloud-test-shard-0&authSource=admin&retryWrites=true",
    "database": "atlas-gridfs_db",
    "user": "<username>",
    "password": "<password>",
    "name": "gridfs_db",
    "connector": "loopback-component-storage-mongo"
  }
}```


prasgema avatar Sep 11 '18 04:09 prasgema

Can you mention the version of mongodb that got downloaded on npm install...it must be in your package-lock.json file.

deostroll avatar Sep 11 '18 11:09 deostroll

It was originally mongodb 2.2.22 and mongodb-core 2.1.7

I tried upgrading it to latest mongodb 3.1.4 and mongodb-core 3.1.3 still throwing the same error

prasgema avatar Sep 11 '18 12:09 prasgema