Mongodb连接失败问题的几种情况和解决方式
2018-01-29 11:21
501 查看
问题一:
E:\Program Files\MongoDB\Server\3.4\bin>mongod.exe --dbpath e:\data\db
2017-07-07T17:13:56.239+0800 I CONTROL [initandlisten] MongoDB starting : pid=27012 port=27017 dbpath=e:\data\db 64-bit host=YIN-PC
2017-07-07T17:13:56.243+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-07-07T17:13:56.244+0800 I CONTROL [initandlisten] db version v3.4.6
2017-07-07T17:13:56.247+0800 I CONTROL [initandlisten] git version: c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5
2017-07-07T17:13:56.251+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
2017-07-07T17:13:56.255+0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-07-07T17:13:56.258+0800 I CONTROL [initandlisten] modules: none
2017-07-07T17:13:56.263+0800 I CONTROL [initandlisten] build environment:
2017-07-07T17:13:56.266+0800 I CONTROL [initandlisten] distmod: 2008plus-ssl
2017-07-07T17:13:56.271+0800 I CONTROL [initandlisten] distarch: x86_64
2017-07-07T17:13:56.274+0800 I CONTROL [initandlisten] target_arch: x86_64
2017-07-07T17:13:56.278+0800 I CONTROL [initandlisten] options: { storage: { dbPath: "e:\data\db" } }
2017-07-07T17:13:56.284+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=2517M,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),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-07-07T17:13:56.926+0800 I CONTROL [initandlisten]
2017-07-07T17:13:56.934+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-07-07T17:13:56.945+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-07-07T17:13:56.957+0800 I CONTROL [initandlisten]
2017-07-07T17:13:57.731+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'e:/data/db/diagnostic.data'
2017-07-07T17:13:58.042+0800 I INDEX [initandlisten] build index on: admin.system.version properties: { v: 2, key: { version: 1 }, name: "incompatible_with_version_32", ns: "admin.system.version" }
2017-07-07T17:13:58.055+0800 I INDEX [initandlisten] building index using bulk method; build may temporarily use up to 500 megabytes of RAM
2017-07-07T17:13:58.107+0800 I INDEX [initandlisten] build index done. scanned 0 total records. 0 secs
2017-07-07T17:13:58.112+0800 I COMMAND [initandlisten] setting featureCompatibilityVersion to 3.4
2017-07-07T17:13:58.118+0800 I NETWORK [thread1] waiting for connections on port 27017
解决方法:
重点强调一下 上面不是问题 解决的方式就是先别关这个A终端,再开个B终端,进入Mongodb安装路径里的bin文件夹输入 mongo、回车,就可以进入mongodb了。
B终端进入mongodb
A终端的变化
问题解决!
问题二:
错误提示:
Mongodbshell version:
3.4.6
connecting to: test
Mon Mar 3 23:45:09.491 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
exception: connect failed
解决方法:
删除data\db\文件下面的mongo.lock文件
重启服务
OK
E:\Program Files\MongoDB\Server\3.4\bin>mongod.exe --dbpath e:\data\db
2017-07-07T17:13:56.239+0800 I CONTROL [initandlisten] MongoDB starting : pid=27012 port=27017 dbpath=e:\data\db 64-bit host=YIN-PC
2017-07-07T17:13:56.243+0800 I CONTROL [initandlisten] targetMinOS: Windows 7/Windows Server 2008 R2
2017-07-07T17:13:56.244+0800 I CONTROL [initandlisten] db version v3.4.6
2017-07-07T17:13:56.247+0800 I CONTROL [initandlisten] git version: c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5
2017-07-07T17:13:56.251+0800 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
2017-07-07T17:13:56.255+0800 I CONTROL [initandlisten] allocator: tcmalloc
2017-07-07T17:13:56.258+0800 I CONTROL [initandlisten] modules: none
2017-07-07T17:13:56.263+0800 I CONTROL [initandlisten] build environment:
2017-07-07T17:13:56.266+0800 I CONTROL [initandlisten] distmod: 2008plus-ssl
2017-07-07T17:13:56.271+0800 I CONTROL [initandlisten] distarch: x86_64
2017-07-07T17:13:56.274+0800 I CONTROL [initandlisten] target_arch: x86_64
2017-07-07T17:13:56.278+0800 I CONTROL [initandlisten] options: { storage: { dbPath: "e:\data\db" } }
2017-07-07T17:13:56.284+0800 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=2517M,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),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2017-07-07T17:13:56.926+0800 I CONTROL [initandlisten]
2017-07-07T17:13:56.934+0800 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2017-07-07T17:13:56.945+0800 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2017-07-07T17:13:56.957+0800 I CONTROL [initandlisten]
2017-07-07T17:13:57.731+0800 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory 'e:/data/db/diagnostic.data'
2017-07-07T17:13:58.042+0800 I INDEX [initandlisten] build index on: admin.system.version properties: { v: 2, key: { version: 1 }, name: "incompatible_with_version_32", ns: "admin.system.version" }
2017-07-07T17:13:58.055+0800 I INDEX [initandlisten] building index using bulk method; build may temporarily use up to 500 megabytes of RAM
2017-07-07T17:13:58.107+0800 I INDEX [initandlisten] build index done. scanned 0 total records. 0 secs
2017-07-07T17:13:58.112+0800 I COMMAND [initandlisten] setting featureCompatibilityVersion to 3.4
2017-07-07T17:13:58.118+0800 I NETWORK [thread1] waiting for connections on port 27017
解决方法:
重点强调一下 上面不是问题 解决的方式就是先别关这个A终端,再开个B终端,进入Mongodb安装路径里的bin文件夹输入 mongo、回车,就可以进入mongodb了。
B终端进入mongodb
A终端的变化
问题解决!
问题二:
错误提示:
Mongodbshell version:
3.4.6
connecting to: test
Mon Mar 3 23:45:09.491 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
exception: connect failed
解决方法:
删除data\db\文件下面的mongo.lock文件
重启服务
OK
相关文章推荐
- Mongodb连接失败问题的几种情况和解决方式
- 编写简单的连接MongoDB数据库C++程序 && 解决编译C++程序时链接MongoDB动态库失败的问题
- java使用“用户名+密码”连接mongodb,认证失败的问题解决
- 编写简单的连接MongoDB数据库C++程序 && 解决编译C++程序时链接MongoDB动态库失败的问题
- MongoDB 配置时无法连接 127.0.0.1:27017 问题解决方式
- 解决mongodb连接失败问题
- 解决mongodb连接失败问题
- 编写简单的连接MongoDB数据库C++程序 && 解决编译C++程序时链接MongoDB动态库失败的问题
- java连接mongodb的一个奇葩问题及奇葩解决方式
- IT168转载问题解决情况,以及本人博客转载方式
- mongodb 3.4下远程连接认证失败的解决方法
- kafka java中发送数据、连接失败问题解决
- kafka java中发送数据、连接失败问题解决
- 关于oracle数据库重装后或ip改变后连接失败的问题解决
- "无法连接到服务器,用户xxx登陆失败" 解决问题
- 数据库安装错误的解决方式 【转】如何处理 SQL Server 安装过程中的 COM+ 检查失败问题 - ...
- 解决烧录问题:Jlink的三线制SWD方式连接STM32芯片无法识别的解决方案
- Linux下g++编译C++连接oracle(OCCI)出现的问题及解决方式