Programing

Mongodb : 127.0.0.1:27017에 연결하지 못했습니다. 이유 : errno : 10061

lottogame 2020. 12. 28. 07:41
반응형

Mongodb : 127.0.0.1:27017에 연결하지 못했습니다. 이유 : errno : 10061


mongod.cfg파일 은 다음과 같습니다 .

bind_ip = 127.0.0.1
dbpath = C:\mongodb\data\db
logpath = C:\mongodb\log\mongo-server.log
verbose=v

mongod서비스 명령 은 다음과 같습니다 .

mongod -f c:\mongodb\mongod.cfg --install

약 일주일 전에 MongoDB를 설치했는데 모두 잘 작동했지만 오늘 mongo명령을 실행했을 때 다음 오류가 발생했습니다.

Failed to connect to 127.0.0.1:27017,
reason: errno:10061 No connection could be made because the target machine actively refused it

어떻게 고칠 수 있습니까? Windows 8.1을 사용합니다.

해결책:

이 명령으로 mongodb 서비스를 시작하는 것을 잊었습니다.

net start mongodb

개선 된 솔루션 :

1) 디렉토리를 루트 드라이브로 변경 C:\하고 관리자 cmd프롬프트 창에 아래 명령을 입력하십시오 .

C:\mongodb\bin\mongod.exe --config c:\mongodb\mongod.cfg --install

2) 그런 다음 입력 net start MongoDB하면 다음 메시지가 표시됩니다.

"The Mongo DB service was started successfully"

3) 그런 다음 제어판 Start>Administrative Tools>Services으로 이동하여 서비스 목록에서 MongoDB로 스크롤하고 원하는 경우 시작 유형을 자동으로 변경합니다. OK를 누르십시오.

4) 마지막으로 입력 C:\mongodb\bin\mongo.exe하면 Mongo 테스트 DB에 연결됩니다.

참조 : https://www.youtube.com/watch?v=-mik4dPArCU


이것이 내가 그것을 해결 한 방법입니다. 여기에서 단계별로 따를 수 있습니다.

MongoDB 단계 :

  • Windows 용 MongoDB 의 최신 64 비트 MSI 버전을 다운로드하십시오 .

  • 설치 프로그램 (.msi 파일) 실행

  • 환경 변수 PATH추가하십시오 . 다음에서되어야합니다.
    C:\Program Files\MongoDB\Server\3.0\bin

이제 mongodb 에서 모든 데이터를 저장하는 데 사용 하는 "\ data \ db"폴더를 C : /에 만듭니다 . 다음 폴더가 있어야합니다.

C : \ data \ db

참고 : 이것은 mongoDB에서 예상하는 기본 디렉토리 위치입니다. 다른 곳에 생성하지 마십시오.

.

마지막으로 명령 프롬프트를 열고 다음을 입력하십시오.

>> mongod

권한을 요청 (허용) 한 다음 포트를 수신해야합니다. 완료되면 다른 명령 프롬프트를 열고 이전 명령 프롬프트는 서버를 실행합니다.

새 명령 프롬프트를 입력하십시오.

>> mongo

버전을 표시하고 테스트 데이터베이스에 연결해야합니다.

이것은 성공적인 설치를 증명합니다! =)

참조 링크


mongod 명령을 입력 할 때 경로도 지정 했습니까? 이것은 일반적으로 문제입니다. conf 파일에 신경 쓸 필요가 없습니다. 간단히 입력

mongod --dbpath = "여기에 데이터베이스 작업 영역을 저장할 경로를 입력하세요 !!이 바보 같은 따옴표없이 추가 할 수도 있습니다!"

예 : mongod --dbpath = C : / Users / kyles2 / Desktop / DEV / mongodb / data

그것이 내 길이며 창에서 복사 한 경우 슬래시를 앞으로 뒤집거나 작동하지 않는 경우 잊지 마십시오!


mongodb 2.6에서도 동일한 문제에 직면했습니다.

내 문제를 해결 한 것은 mongod --repair명령을 실행하는 것입니다.

그리고 시작 mongod.exe

그것은 나를 위해 일했습니다


Windows7 32 비트의 mongodb 2.6.8에서는 c : / data / db 폴더를 생성하기 만하면됩니다. mongod를 실행하고 mongo를 실행합니다.


mongodb 설치 (예 : C : \ Program Files \ MongoDB \ Serve \ bin)를 가리키고 mongod.exe를 실행하여 127.0.0.1:27017에 대한 연결을 열 수 있습니다.


일반적인 경우 최소 3379MB의 디스크 공간이 필요합니다. 없는 경우;

mongod.exe --smallfiles

이것이 유일한 요구 사항은 아닙니다. 그러나 이것은 당신의 문제 일 수 있습니다.


문제는 명령에서 dbpath에 대한 'db'폴더를 놓쳤다는 것입니다.

C:\mongodb\bin> mongod --directoryperdb --dbpath C:\mongodb\data\db --logpath C:\mongodb\log\mongodb.log --logappend -rest --install

그냥 폴더를 만드세요

C:\data\db 

명령 프롬프트에서 아래 명령 실행

C:\Program Files\MongoDB\Server\3.4\bin>mongod

다른 명령 프롬프트를 엽니 다.

C:\Program Files\MongoDB\Server\3.4\bin>mongo

제대로 종료되지 않았거나 mongod.lock이 비어 있지 않다고 기록되면 C : \ data \ db \에서 mongod.lock 만 삭제하면 시작됩니다.


What solved my issue was creating a file startmongo.conf that sets the bind_ip to 127.0.0.1 . After that, I just created a *.bat to start the mongo using something like:

mongod --config c:\mongodb\bin\startmongo.conf

When This Error is Coming it is lack of the following

1)Setting the path to mongo db go to "C" Drive and the installation of Mongo db directory and then go to bin folder in the mongo and copy the path of it

c:/mongodb/server/3.2/bin/ and create a new environmental variable in system properties then name is path and value="c:/mongodb/server/3.2/bin/" here my version is 3.2

2)create a data directory for the data in C Drive c:/Data/twitter

3)start the server with **

c:/> mongod

check your port config if there is any error as the local port may be assigned to any other 4)start your Mongo database with

Mongo then your mongo db will start

then in your mongo database create a database

use DATABASE_NAME

for example:

use twitterdata

switched to db twitterdata

to check your current database

db

twitterdata

to get total databases

show dbs


I started mongod in cmd,It threw error like C:\data\db\ not found. Created folder then typed mongod opened another cmd typed mongo it worked.


Here are the steps to solve this issue:

  1. Just go to your MongoDB bin folder and run the mongod.exe file.
  2. Navigate to your mongodb bin folder via Command prompt and start mongo by typing "mongo"

Change file permission to 755 for the file:

/var/lib/mongodb/mongod.lock

first you run the command mongod and check weather the port 27017 has started or not if yes then hit the command mongo....and database will start.


The Port is not open. Thats why the machine refuses communication


Try this, it worked for me.

mongod --storageEngine=mmpav1

ReferenceURL : https://stackoverflow.com/questions/26585433/mongodb-failed-to-connect-to-127-0-0-127017-reason-errno10061

반응형