어떤 이유로 든 MongoDB를 서비스로 시작하려고 할 때마다 (sudo service mongod start) 다음 오류가 발생합니다.
mongod.service를 시작하지 못했습니다 : mongod.service 장치를 찾을 수 없습니다. 링크 몽고 DB 설치에 실패한 다음 설치 단계 언급을 따랐습니다.
system> sudo systemctl start mongodb
Failed to start mongodb.service: Unknown unit: mongodb.service
그리고 내가 시도 할 때 sudo mongod
:
MongoDB shell version: 3.2.13 connecting to: -
2017-06-03T16:19:28.513+0530 W NETWORK [thread1]
Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused
2017-06-03T16:19:28.514+0530 E QUERY [thread1]
Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:229:14 @(connect):1:6 exception: connect failed
그리고 내가 시도 할 때 mongod --repair
:
2017-06-03T16:32:35.514+0530 I CONTROL [initandlisten]
MongoDB starting : pid=17423 port=27017 dbpath=/data/db 64-bit host=sid-Ideapad-Z570 2017-06-03T16:32:35.514+0530 I
CONTROL [initandlisten] db version v3.2.13 [listen] target_arch: x86_64 2017-06-03T16:32:35.514+0530 I
CONTROL [initandlisten] options: {} 2017-06-03T16:32:35.540+0530 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating
/usr/bin/mongod
; 이 명령의 출력이 있다면sudo mongod
MongoDB shell version: 3.2.13 connecting to: - 2017-06-03T16:19:28.513+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused 2017-06-03T16:19:28.514+0530 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:229:14 @(connect):1:6 exception: connect failed
mongod --repair
다음 시도하십시오 sudo mongod
; 도움이 될 수도 있습니다
ls /etc/systemd/system | grep mongo
?