Özel durumum:
daha önce mongod'u şu şekilde başlatın:
sudo -u mongod mongod -f /etc/mongod.conf
şimdi, durmak istiyorum mongod.
ve resmi dokümanı durdur Mongod Süreçlerini durdur , denedi:
(1) shutdownServerancak başarısız oldu:
> use admin
switched to db admin
> db.shutdownServer()
2019-03-06T14:13:15.334+0800 E QUERY [thread1] Error: shutdownServer failed: {
"ok" : 0,
"errmsg" : "shutdown must run from localhost when running db without auth",
"code" : 13
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.shutdownServer@src/mongo/shell/db.js:302:1
@(shell):1:1
(2) --shutdownhala başarısız oldu:
# mongod --shutdown
There doesn't seem to be a server running with dbpath: /data/db
(3) önceki başlatma komutu ekleme - kapatma:
sudo -u mongod mongod -f /etc/mongod.conf --shutdown
killing process with pid: 30213
failed to kill process: errno:1 Operation not permitted
(4) servicedurdurmak için kullanın :
service mongod stop
ve
service mongod status
Beklenen göstermek Active: inactive (dead)ama mongodaslında hala çalışıyor, çünkü ps sürecini görebilirsiniz:
# ps -edaf | grep mongo | grep -v grep
root 30213 1 0 Feb04 ? 03:33:22 mongod --port PORT --dbpath=/var/lib/mongo
ve son olarak , mongod'u gerçekten durdurun:
# sudo mongod -f /etc/mongod.conf --shutdown
killing process with pid: 30213
Şimdiye kadar, temel nedeni: hala bilinmiyor ...
umarım yukarıdaki çözüm sizin için yararlıdır.
sudo service mongodb [start|stop|restart|status].sudo service stop mongodbsonuç: dur: tanınmayan hizmet