inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

따라하며 배우는 노드, 리액트 시리즈 - 기본 강의

노드 리액트 기초 강의 #7 BodyParser & PostMan & 회원 가입 기능

db connectio 에러

278

wwwpyk

작성한 질문수 3

0

DB 연결에서 계속 오류가 나요

에러 메시지 보고 cmd 창에서 ip 보고 mongoDB network access 에서 ip 수정하고 다시 이전꺼랑 해서 새로 추가했는데 동일하게 오류가 나와요

확인 부탁드립니다 ㅜㅜ

PS D:\nodeJs\models> npm run start

> nodejs@1.0.0 start D:\nodeJs

> node index.js

Example app listening at http://localhost:5100

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://docs.atlas.mongodb.com/security-whitelist/

    at NativeConnection.Connection.openUri (D:\nodeJs\node_modules\mongoose\lib\connection.js:846:32)

    at D:\nodeJs\node_modules\mongoose\lib\index.js:351:10

    at D:\nodeJs\node_modules\mongoose\lib\helpers\promiseOrCallback.js:32:5

    at new Promise (<anonymous>)

    at promiseOrCallback (D:\nodeJs\node_modules\mongoose\lib\helpers\promiseOrCallback.js:31:10)

    at Mongoose._promiseOrCallback (D:\nodeJs\node_modules\mongoose\lib\index.js:1149:10)

    at Mongoose.connect (D:\nodeJs\node_modules\mongoose\lib\index.js:350:20)

    at Object.<anonymous> (D:\nodeJs\index.js:14:10)

    at Module._compile (internal/modules/cjs/loader.js:1251:30)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1272:10)

    at Module.load (internal/modules/cjs/loader.js:1100:32)

    at Function.Module._load (internal/modules/cjs/loader.js:962:14)

    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)

    at internal/main/run_main_module.js:17:47 {

  reason: TopologyDescription {

    type: 'ReplicaSetNoPrimary',

    setName: null,

    maxSetVersion: null,

    maxElectionId: null,

    servers: Map(3) {

      'wwwpyk-shard-00-01.7lopm.mongodb.net:27017' => [ServerDescription],

      'wwwpyk-shard-00-02.7lopm.mongodb.net:27017' => [ServerDescription],

      'wwwpyk-shard-00-00.7lopm.mongodb.net:27017' => [ServerDescription]

    },

    stale: false,

    compatible: true,

    compatibilityError: null,

    logicalSessionTimeoutMinutes: null,

    heartbeatFrequencyMS: 10000,

    localThresholdMS: 15,

    commonWireVersion: null

  }

}

db nodejs react

답변 1

0

푸르

터미널창에 ipconfig 입력해 ipv4의 ip주소를 혹시 적으셨나요? 그거 말고 공인 IP를 입력해야 되더라구요. 공인 IP는 네이버에 "내 ip 주소 확인" 이나 mongoDB > network access > 새 ip 추가하실 때 왼쪽 상단에 current ip address 누르면 나옵니다! 도움이 되시면 좋겠네요. 

0

반바지 (-BanBaZy)

같은 에러로 골치 아팠었는데 덕분에 해결했습니다. 정말 감사합니다.

깃 이메일이랑 비번이 필요하다고 하네요

0

54

1

404 에러

0

120

1

34강 인증 체크에서 element 사용 때문에 에러나시는 분들 이렇게 하심 됩니다.

0

138

1

로그인, 로그아웃, 토근 작동 안 함

0

256

0

9강 오류 어떻게 해결하나요?

0

198

1

localhost 에서 연결을 거부했습니다.

0

1972

4

포스트맨에서 true가 안떠요

0

157

1

왜 안되나요

0

133

1

몽고db 연결 오류가 납니다 위에껀 입력한 코드, 아래껀 터미널이에요

0

250

1

로그아웃 401 에러(Unauthorized)

0

519

2

암호가 해싱되지 않고 입력값 그대로 db에 저장되는 문제

0

159

1

7강중에서

0

177

2

User.findByToken is not a function

0

215

1

루트 디렉토리

0

281

1

useState

0

570

1

프록시 잘 설정했는데도 404 오류 뜨는 분들

5

905

6

webpack 관련 에러 질문

0

225

1

리액트 관련 질문

0

282

1

14강 로그아웃 안됨

0

325

1

mongoDB 데이터 확인하는 법

0

414

1

postman 에러

0

297

1

선생님 리덕스를 사용하면 어떠한 부분이 좋은지 알 수 있을까요?

0

240

1

다음과 같은 에러들이 발생합니다.

0

282

1

14강 로그아웃 기능 구현시 postman에서 Cannot POST 오류가 뜹니다.

0

385

1