mongo-express/mongo-express

Can't connect to replica set on MongoAtlas

Open

#272 ouverte le 18 oct. 2016

Voir sur GitHub
 (63 commentaires) (2 réactions) (0 assignés)JavaScript (5 095 stars) (915 forks)batch import
bughelp wanted

Description

I get the following error when I try and start mongo-express.

/home/jamrizzi/GroupThreads/mongui/node_modules/mongodb/lib/replset.js:360
          process.nextTick(function() { throw err; })
                                        ^
MongoError: no valid replicaset members found
    at Timeout.<anonymous> (/home/jamrizzi/GroupThreads/mongui/node_modules/mongodb-core/lib/topologies/replset.js:645:33)
    at tryOnTimeout (timers.js:232:11)
    at Timer.listOnTimeout (timers.js:202:5)

I have it configured as a replica set, and I have verified that all the information I entered is correct by trying it with the mongodb CLI. Below is the way I have it configured.

  mongo = {
    db:       'admin',
    host:     [
        'rest-api-data-shard-00-00-xemv3.mongodb.net',
        'rest-api-data-shard-00-01-xemv3.mongodb.net',
        'rest-api-data-shard-00-02-xemv3.mongodb.net'
    ],
    password: 'myspecialpassword',
    port:     27017,
    ssl:      true,
    url:      'mongodb://rest-api-data-shard-00-00-xemv3.mongodb.net:27017,rest-api-data-shard-00-01-xemv3.mongodb.net:27017,rest-api-data-shard-00-02-xemv3.mongodb.net:27017/admin?replicaSet=rest-api-data-shard-0',
    username: 'myspecialusername'
  };

Guide contributeur