鍍金池/ 問答/數(shù)據(jù)庫  HTML/ mongodb在win10環(huán)境下運行問題

mongodb在win10環(huán)境下運行問題

在win10環(huán)境下安裝mongodb,安裝路徑為C:Program FilesMongoDBServer4.0\

以管理員身份運行cmd,在C盤下創(chuàng)建mongodbdatadb及mongodblogmongo.log文件

在C:Program FilesMongoDBServer4.0bin下運行mongod --dbpath C:mongodbdatadb指定mongodb數(shù)據(jù)緩存路徑

cmd中展示為:
C:Program FilesMongoDBServer4.0bin>mongod --dbpath C:mongodbdatadb
2018-08-16T14:58:46.980+0800 I CONTROL [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2018-08-16T14:58:47.372+0800 I CONTROL [initandlisten] MongoDB starting : pid=1200 port=27017 dbpath=C:mongodbdatadb 64-bit host=DESKTOP-UCTKPJL
2018-08-16T14:58:47.372+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2018-08-16T14:58:47.374+0800 I CONTROL [initandlisten] db version v4.0.0
2018-08-16T14:58:47.376+0800 I CONTROL [initandlisten] git version: 3b07af3d4f471ae89e8186d33bbb1d5259597d51
2018-08-16T14:58:47.377+0800 I CONTROL [initandlisten] allocator: tcmalloc
2018-08-16T14:58:47.377+0800 I CONTROL [initandlisten] modules: none
2018-08-16T14:58:47.377+0800 I CONTROL [initandlisten] build environment:
2018-08-16T14:58:47.378+0800 I CONTROL [initandlisten] distmod: 2008plus-ssl
2018-08-16T14:58:47.378+0800 I CONTROL [initandlisten] distarch: x86_64
2018-08-16T14:58:47.378+0800 I CONTROL [initandlisten] target_arch: x86_64
2018-08-16T14:58:47.379+0800 I CONTROL [initandlisten] options: { storage: { dbPath: "C:mongodbdatadb" } }
2018-08-16T14:58:47.438+0800 I STORAGE [initandlisten] Detected data files in C:mongodbdatadb created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
2018-08-16T14:58:47.439+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7618M,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-08-16T14:58:47.619+0800 I STORAGE [initandlisten] WiredTiger message 1534402727:618697, txn-recover: Main recovery loop: starting at 5/9600
2018-08-16T14:58:47.756+0800 I STORAGE [initandlisten] WiredTiger message 1534402727:756428, txn-recover: Recovering log 5 through 6
2018-08-16T14:58:47.838+0800 I STORAGE [initandlisten] WiredTiger message 1534402727:838275, txn-recover: Recovering log 6 through 6
2018-08-16T14:58:47.907+0800 I STORAGE [initandlisten] WiredTiger message 1534402727:907659, txn-recover: Set global recovery timestamp: 0
2018-08-16T14:58:47.952+0800 I RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
2018-08-16T14:58:47.996+0800 I CONTROL [initandlisten]
2018-08-16T14:58:47.997+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-08-16T14:58:47.999+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2018-08-16T14:58:48.002+0800 I CONTROL [initandlisten]
2018-08-16T14:58:48.002+0800 I CONTROL [initandlisten] ** WARNING: This server is bound to localhost.
2018-08-16T14:58:48.003+0800 I CONTROL [initandlisten] ** Remote systems will be unable to connect to this server.
2018-08-16T14:58:48.003+0800 I CONTROL [initandlisten] ** Start the server with --bind_ip <address> to specify which IP
2018-08-16T14:58:48.003+0800 I CONTROL [initandlisten] ** addresses it should serve responses from, or with --bind_ip_all to
2018-08-16T14:58:48.004+0800 I CONTROL [initandlisten] ** bind to all interfaces. If this behavior is desired, start the
2018-08-16T14:58:48.004+0800 I CONTROL [initandlisten] ** server with --bind_ip 127.0.0.1 to disable this warning.
2018-08-16T14:58:48.004+0800 I CONTROL [initandlisten]
2018-08-16T14:58:48.737+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'C:/mongodb/data/db/diagnostic.data'
2018-08-16T14:58:48.747+0800 I NETWORK [initandlisten] waiting for connections on port 27017

顯示等待鏈接

重新以管理員身份打開cmd,進入到C:Program FilesMongoDBServer4.0bin下運行mongo開啟mongdb鏈接
報鏈接失敗
C:Program FilesMongoDBServer4.0bin>mongo
MongoDB shell version v4.0.0
connecting to: mongodb://127.0.0.1:27017
2018-08-16T15:00:44.465+0800 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: NetworkTimeout: Error connecting to 127.0.0.1:27017 :: caused by :: Socket operation timed out :
connect@src/mongo/shell/mongo.js:251:13
@(connect):1:6
exception: connect failed

回答
編輯回答
舊時光

up up up...

2017年8月7日 12:13