mongodb OSX系統下連線失敗
天蓬老师
天蓬老师 2017-05-17 10:01:53
0
3
616

昨天還可以用到好好的,今天一開機連不上資料庫了,新手完全不知道該怎麼調試了,求指點
日誌如下
開啟mongod
Last login: Sun May 7 07:59:35 on ttys001
192-168-1-8:~ zuoan$ cd /Applications/Mongo/bin
192-168-1-8:bin zuoan$ mongod
2017-05- 07T08:53:53.828 1000 I CONTROL [initandlisten] MongoDB starting : pid=1802 port=27017 dbpath=/data/db 64-bit host=192-168-1-8.tpgi.com.au. -07T08:53:53.828 1000 I CONTROL [initandlisten] db version v3.4.4
2017-05-07T08:53:53.828 1000 I CONTROL [initandlisten] 53.8283cavers 6b44babd
2017-05-07T08:53: 53.828 1000 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2k 26 Jan 2017
2017-05-07T08:53:53.828 1000 I CONTROL [locinand08:53:53.828 1000 I CONTROL [locinand list] al. 8 1000 I CONTROL [initandlisten] modules: none
2017-05-07T08:53:53.828 1000 I CONTROL [initandlisten] build environment:
2017-05-07T08:53:53.828 1000 I CONTROL [initandlisten] distarch: x86_64
2017-05-07T08:53:53.828 1000 I CONTROL [initandlisten] target_arch: x86_64
2017-05-07T08:53:53.828 1000 I CONTROL [initandlisten] options: {}
2017-05 -07T08:53:53.830 1000 I STORAGE [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating
2017-05-07505-0753:
2017 5-07505 NETWORK [initandlisten] shutdown: going to close listening sockets...
2017-05-07T08:53:53.830 1000 I NETWORK [initandlisten] shutdown: going to flush diaglog...#. 53:53.831 1000 I CONTROL [initandlisten] now exiting
2017-05-07T08:53:53.831 1000 I CONTROL [initandlisten] shutting down with code:100

開啟mongo

192-168-1-8:bin zuoan$ mongo

MongoDB shell version v3.4.4
connecting to: mongodb://127.0.0.1:27017
2017-05 -07T08:54:05.079 1000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused##20. QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1: 6
exception: connect failed

挺急的,線上求助

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

全部回覆 (3)
黄舟

應該是權限問題:

2017-05-07T08:53:53.830+1000 I STORAGE [initandlisten] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating

仔細檢查 /data/db 資料夾的權限是什麼。

    过去多啦不再A梦

    sudo chown -R 使用者名稱 /data/db

      巴扎黑

      感覺是權限問題,我推薦你用homebrew重新裝一下,我用了homebrew安裝了以來就很少遇到這樣的問題了。

        最新下載
        更多>
        網站特效
        網站源碼
        網站素材
        前端模板
        關於我們 免責聲明 Sitemap
        PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!