鍍金池/ 問答/數(shù)據(jù)庫/ MongoDB鏈接失敗 mongo "exception: conne

MongoDB鏈接失敗 mongo "exception: connect failed "

電腦是 WIN 10 系統(tǒng)
我按照這個教程安裝mongoDB,
http://www.runoob.com/mongodb...

但一輸入 mongo 鏈接.就報這個錯誤

圖片描述

已經(jīng)重裝過幾回,也沒有解決 .
也換過 dbpath 也是沒用, 求大神幫助

這是那個mongodb.log 日志,

2018-03-27T14:00:19.299+0800 I CONTROL  [main] ***** SERVER RESTARTED *****
2018-03-27T14:00:19.647+0800 I CONTROL  [main] Trying to start Windows service 'MongoDB'
2018-03-27T14:00:19.648+0800 I CONTROL  [initandlisten] MongoDB starting : pid=10480 port=27017 dbpath=d:\mongodbData\db 64-bit host=DESKTOP-KEA31I3
2018-03-27T14:00:19.648+0800 I CONTROL  [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2018-03-27T14:00:19.648+0800 I CONTROL  [initandlisten] db version v3.6.3
2018-03-27T14:00:19.648+0800 I CONTROL  [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
2018-03-27T14:00:19.648+0800 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips  22 Sep 2016
2018-03-27T14:00:19.648+0800 I CONTROL  [initandlisten] allocator: tcmalloc
2018-03-27T14:00:19.648+0800 I CONTROL  [initandlisten] modules: none
2018-03-27T14:00:19.648+0800 I CONTROL  [initandlisten] build environment:
2018-03-27T14:00:19.649+0800 I CONTROL  [initandlisten]     distmod: 2008plus-ssl
2018-03-27T14:00:19.649+0800 I CONTROL  [initandlisten]     distarch: x86_64
2018-03-27T14:00:19.649+0800 I CONTROL  [initandlisten]     target_arch: x86_64
2018-03-27T14:00:19.649+0800 I CONTROL  [initandlisten] options: { service: true, storage: { dbPath: "d:\mongodbData\db" }, systemLog: { destination: "file", logAppend: true, path: "d:\mongodbData\log\mongodb.log" } }
2018-03-27T14:00:19.651+0800 I -        [initandlisten] Detected data files in d:\mongodbData\db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-03-27T14:00:19.651+0800 I STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=7632M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress),
2018-03-27T14:00:19.834+0800 I STORAGE  [initandlisten] WiredTiger message [1522130419:833660][10480:140722874245456], txn-recover: Main recovery loop: starting at 4/6272
2018-03-27T14:00:19.970+0800 I STORAGE  [initandlisten] WiredTiger message [1522130419:970024][10480:140722874245456], txn-recover: Recovering log 4 through 5
2018-03-27T14:00:20.046+0800 I STORAGE  [initandlisten] WiredTiger message [1522130420:46191][10480:140722874245456], txn-recover: Recovering log 5 through 5
2018-03-27T14:00:20.172+0800 I CONTROL  [initandlisten] 
2018-03-27T14:00:20.172+0800 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-03-27T14:00:20.172+0800 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-03-27T14:00:20.172+0800 I CONTROL  [initandlisten] 
2018-03-27T14:00:20.173+0800 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2018-03-27T14:00:20.173+0800 I CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server. 
2018-03-27T14:00:20.173+0800 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP 
2018-03-27T14:00:20.173+0800 I CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to
2018-03-27T14:00:20.173+0800 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2018-03-27T14:00:20.173+0800 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2018-03-27T14:00:20.173+0800 I CONTROL  [initandlisten] 
2018-03-27T14:00:20.173+0800 I CONTROL  [initandlisten] 
2018-03-27T14:00:20.173+0800 I CONTROL  [initandlisten] ** WARNING: The file system cache of this machine is configured to be greater than 40% of the total memory. This can lead to increased memory pressure and poor performance.
2018-03-27T14:00:20.174+0800 I CONTROL  [initandlisten] See http://dochub.mongodb.org/core/wt-windows-system-file-cache
2018-03-27T14:00:20.174+0800 I CONTROL  [initandlisten] 
2018-03-27T14:00:20.402+0800 I FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory 'd:/mongodbData/db/diagnostic.data'
2018-03-27T14:00:20.404+0800 I NETWORK  [initandlisten] waiting for connections on port 27017
2018-03-27T14:00:20.404+0800 I STORAGE  [initandlisten] Service running
回答
編輯回答
司令

找到原因了.
是系統(tǒng)防火墻引起的.
關(guān)閉WIN10系統(tǒng)的防火墻就好了

2018年1月13日 09:40
編輯回答
艷骨

直接在bin文件夾下,將mongo拖到cmd窗口試試能運行嗎

2017年6月13日 02:28