我在装有Windows 8.1的笔记本电脑上安装了Mongo数据库,我已经下载了以下版本的Mongodb用于安装目的:
[下载链接] [1]
Windows选项64 2008 R2 +选项
安装后无法正常工作。
我已经有了默认路径,如:
C:\数据\分贝 C:\ Program Files \ MongoDB \ Server \ 3.2 \ bin
当我要运行Mongodb时,我遇到以下错误:
C:\Program Files\MongoDB\Server\3.2\bin>mongo.exe
MongoDB shell version: 3.2.1
connecting to: test
2016-02-13T15:06:56.643+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1
:27017, reason: errno:10061 No connection could be made because the target machi
ne actively refused it.
2016-02-13T15:06:56.645+0530 E QUERY [thread1] Error: couldn't connect to ser
ver 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:224:14
@(connect):1:6
exception: connect failed
C:\Program Files\MongoDB\Server\3.2\bin>mongod.exe
2016-02-13T15:16:14.082+0530 I CONTROL [initandlisten] MongoDB starting : pid=6
156 port=27017 dbpath=C:\data\db\ 64-bit host=DELL
2016-02-13T15:16:14.084+0530 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2016-02-13T15:16:14.107+0530 I CONTROL [initandlisten] options: {}
2016-02-13T15:16:14.110+0530 I - [initandlisten] Detected data files in C
:\data\db\ created by the 'wiredTiger' storage engine, so setting the active sto
rage engine to 'wiredTiger'.
2016-02-13T15:16:14.114+0530 I STORAGE [initandlisten] wiredtiger_open config:
create,cache_size=1G,session_max=20000,eviction=(threads_max=4),config_base=fals
e,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snapp
y),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_size=2GB),stati
stics_log=(wait=0),
2016-02-13T15:16:16.094+0530 I NETWORK [HostnameCanonicalizationWorker] Startin
g hostname canonicalization worker
2016-02-13T15:16:16.094+0530 I FTDC [initandlisten] Initializing full-time d
iagnostic data capture with directory 'C:/data/db/diagnostic.data'
2016-02-13T15:16:16.111+0530 I NETWORK [initandlisten] waiting for connections
on port 27017
我在互联网上交叉了很多东西,就像我发现以下链接一样,为此目的运行了以下防火墙命令:
netsh advfirewall firewall add rule name="Open mongod port 27017" dir=in action=allow protocol=TCP localport=27017
netsh advfirewall firewall add rule name="Allowing mongod" dir=in action=allow program="C:\Program Files\MongoDB\Server\3.2\bin\mongod.exe"
netsh advfirewall firewall add rule name="Allowing mongos" dir=in action=allow program="C:\Program Files\MongoDB\Server\3.2\bin\mongos.exe"
netsh advfirewall firewall add rule name="Open mongod shard port 27018" dir=in action=allow protocol=TCP localport=27018
netsh advfirewall firewall add rule name="Open mongod config svr port 27019" dir=in action=allow protocol=TCP localport=27019
netsh advfirewall firewall add rule name="Open mongod config svr inbound" dir=in action=allow protocol=TCP remoteip=127.0.0.1 localport=27019
netsh advfirewall firewall add rule name="Open mongod config svr inbound" dir=in action=allow protocol=TCP remoteip=127.0.0.1 localport=27017
netsh advfirewall firewall add rule name="Open mongod shardsvr inbound" dir=in action=allow protocol=TCP remoteip=127.0.0.1 localport=27018
netsh advfirewall firewall add rule name="Open mongod shardsvr outbound" dir=out action=allow protocol=TCP remoteip=127.0.0.1 localport=27018
netsh advfirewall firewall add rule name="Open mongod shardsvr inbound" dir=in action=allow protocol=TCP remoteip=127.0.0.1 localport=27017
netsh advfirewall firewall add rule name="Open mongod shardsvr outbound" dir=out action=allow protocol=TCP remoteip=127.0.0.1 localport=27017
netsh advfirewall firewall add rule name="Open mongod config svr outbound" dir=out action=allow protocol=TCP remoteip=127.0.0.1 localport=27018
netsh advfirewall firewall add rule name="Open mongod config svr outbound" dir=out action=allow protocol=TCP remoteip=127.0.0.1 localport=27017
netsh advfirewall firewall add rule name="Open mongod HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=127.0.0.1 localport=28017
netsh advfirewall firewall add rule name="Open mongod HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=127.0.0.1 localport=27017
netsh advfirewall firewall add rule name="Open mongos HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=127.0.0.1 localport=28018
netsh advfirewall firewall add rule name="Open mongos HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=127.0.0.1 localport=27017
netsh advfirewall firewall add rule name="Open mongod configsvr HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=127.0.0.1 localport=28019
netsh advfirewall firewall add rule name="Open mongod configsvr HTTP monitoring inbound" dir=in action=allow protocol=TCP remoteip=127.0.0.1 localport=27017
但Mongo数据库仍无效。请帮我成功运行Mongo DB。
答案 0 :(得分:2)
检查mongo服务是否正在运行。如果没有开始,请尝试
net start mongodb
您可以执行win+r
services.msc