mongodb에서 윈도우즈 서비스를 등록할 수 없습니다
5919 단어 데이터베이스
mongodb에서 윈도우즈 서비스를 등록할 수 없습니다
1:MongoDB를 설치한 후 윈도우즈 서비스로 등록합니다.
두 가지 방법이 있습니다.
mongod --dbpath "D:\1\12\mongodb\data\db" --logpath "D:\1\12\mongodb\data\log\mongodb.log" --install --serviceName "MongoDB"
dbpath = "D:\Program Files\MongoDB\Data\DB"
logpath = "D:\Program Files\MongoDB\Data\Log\mongodb.log"
logappend = true
directoryperdb = true
serviceName = "MongoDBService"
serviceDisplayName = "MongoDBService"
port = 27017
명령이 실행된 후 명령줄은 아무런 출력도 없이 끝났지만, 서비스를 시작할 때 넷 start Mongo 서비스를 호출해도 반응이 없습니다. 가입 서비스가 실패했습니다.
로그 파일 보기 mongodb.log, 다음 레코드 발견:
59:46.730+0800 I CONTROL [main] ***** SERVER RESTARTED *****
59:47.130+0800 I CONTROL [main] Trying to install Windows service 'MongoDBService'
59:47.130+0800 I CONTROL [main] Error connecting to the Service Control Manager: 。 (5)
해결 방법:
cmd를 찾았습니다.exe, 관리자로 오른쪽 단추를 눌러서 실행한 다음 상기 등록 서비스의 명령을 실행합니다.
2: 또 오류 보고:
logPath requires an absolute file path with Windows services
dbPath requires an absolute file path with Windows services
해결 방법:
구성 파일의 따옴표 제거
3: 설치 성공:
등록 서비스의 명령을 다시 실행한 후 로그를 보면 다음과 같은 기록이 발견되어 설치가 성공했음을 알 수 있습니다.
23:53.286+0800 I CONTROL [main] Trying to install Windows service '"MongoDBService"'
23:53.286+0800 I CONTROL [main] Service '"MongoDBService"' ("MongoDBService1") installed with command line '"D:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --config D:\program\MongoDB\mongo.conf --service'
23:53.286+0800 I CONTROL [main] Service can be started from the command line with 'net start "MongoDBService"'
4: 서비스 시작:
D:\>net start MongoDBService
The MongoDBService1 service is starting...
The MongoDBService1 service was started successfully.
5: 서비스 삭제 중지
net stop MongoDBService
mongod.exe --remove --serviceName "MongoDB"
구성 파일에\"\"번호가 없으면 경로 문제,\"\"서비스 이름에 문제가 발생할 수 있으므로 주의하십시오.올바른 구성 파일:
dbpath = D:\Program Files\MongoDB\Data\DB
logpath = D:\Program Files\MongoDB\Data\Log\mongodb.log
logappend = true
directoryperdb = true
serviceName = MongoDBService
serviceDisplayName = MongoDBService
port = 27017
"서비스 이름에""이(가) 있는 경우 등록 삭제를 시작할 때 필요한 경우""이(가) 필요합니다."
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
SQLite의 query로 망설임이것은 내가 처음 안드로이드 응용 프로그램 개발에서 망설이고, 그 후 해결 된 방법을 비망록으로 철자하고 있습니다. java에서 SQLite를 이용한 애플리케이션을 작성하는 동안 EditText에 입력된 item이 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.