@wzaxc

Не получается запустить сервер на mongoDb (node.js), что делать?

Решил запустить свой node.js сервер на mongoDb по гайду из ютуба. Регистрировался, настривал сервер с впн, при запуске вышла ошибка, что айпи не в white листе, пробую с впн и без впн не получается, что делать?
Сама ошибка:
MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/
at _handleConnectionErrors (/Users/kamila/backend:frontend/node_modules/mongoose/lib/connection.js:809:11)
at NativeConnection.openUri (/Users/kamila/backend:frontend/node_modules/mongoose/lib/connection.js:784:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
reason: TopologyDescription {
type: 'ReplicaSetNoPrimary',
servers: Map(3) {
'ac-mnbfcjb-shard-00-02.bwz1wzm.mongodb.net:27017' => [ServerDescription],
'ac-mnbfcjb-shard-00-00.bwz1wzm.mongodb.net:27017' => [ServerDescription],
'ac-mnbfcjb-shard-00-01.bwz1wzm.mongodb.net:27017' => [ServerDescription]
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: 'atlas-vi92h8-shard-0',
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined
}
[nodemon] restarting due to changes...
[nodemon] starting `node index1.js`
Server OK
DB error MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://www.mongodb.com/docs/atlas/security-whitelist/
at _handleConnectionErrors (/Users/kamila/backend:frontend/node_modules/mongoose/lib/connection.js:809:11)
at NativeConnection.openUri (/Users/kamila/backend:frontend/node_modules/mongoose/lib/connection.js:784:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
reason: TopologyDescription {
type: 'ReplicaSetNoPrimary',
servers: Map(3) {
'ac-mnbfcjb-shard-00-02.bwz1wzm.mongodb.net:27017' => [ServerDescription],
'ac-mnbfcjb-shard-00-00.bwz1wzm.mongodb.net:27017' => [ServerDescription],
'ac-mnbfcjb-shard-00-01.bwz1wzm.mongodb.net:27017' => [ServerDescription]
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: 'atlas-vi92h8-shard-0',
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined
  • Вопрос задан
  • 95 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы