我得到這個錯誤,而不是我的shell提示符(運行Ubuntu 16.04LTS)。將MongoDB 3.4降級到3.2,無法連接到shell
我對MongoDB很新。我已經從3.4版本降級到3.2: https://docs.mongodb.com/manual/release-notes/3.4-downgrade-standalone/
我遵循這些說明(我認爲)很忠實,但現在不能訪問外殼確認等
[email protected]:~$ mongo
MongoDB shell version: 3.2.15
connecting to: test
2017-07-13T14:41:31.434-0400 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-07-13T14:41:31.434-0400 E QUERY [thread1] Error: couldn't
connect to server 127.0.0.1:27017, connection attempt failed :
[email protected]/mongo/shell/mongo.js:229:14
@(connect):1:6
exception: connect failed
有一個該錯誤似乎在/tmp/mongodb-27017.sock
每這些被引用套接字文件,我結束了去除套接字文件,然後試圖重新啓動mongod的後臺程序:
'Failed to unlink socket file" error in MongoDB 3.0 MongoDB - Permission denied for socket: /tmp/mongodb-27017.sock
service mongod restart
service mongod status
[email protected]:~$ service mongod status
● mongod.service - High-performance, schema-free document-oriented
database
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor
preset: enabled)
Active: active (running) since Thu 2017-07-13 14:58:08 EDT; 4s ago
Docs: https://docs.mongodb.org/manual
Main PID: 4763 (mongod)
CGroup: /system.slice/mongod.service
└─4763 /usr/bin/mongod --quiet --config /etc/mongod.conf
Jul 13 14:58:08 scorpo systemd[1]: Started High-performance, schema-
free document-oriented database.
每這些,我刪除了套接字文件並運行:
[email protected]:~$ ls -ld /tmp
drwxrwxrwt 17 root root 20480 Jul 13 14:58 /tmp
我想我在這裏有點失落,我的印象是,在守護進程的重新啓動,它會重新創建這個臨時文件,此時我會檢查權限。
我目前找不到鏈接,但在其他地方發現了一些指示,以確保mongod.sock文件的所有者是mongod(不是root),如果它不是mongod 。
我很喜歡MongoDB,就像我說的。我發現這是另一個可能的問題,但是想看看我是否應該潛入這個兔子洞或者我是否可能在錯誤的地方看?
Connection refused to MongoDB errno 111
謝謝。