本地连接mongo报错,错误代码为:

Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector. 
Client view of cluster state is {type=UNKNOWN, servers= ...............................

系统:

  centos7, 64位

  mongo,mongodb-linux-x86_64-rhel70-4.0.10

解压,进入bin,启动

 ./mongod --dbpath=/data/db/ --config=./mongodb.conf &

报错了

为什么呢?

用linux本地连接mongo测试 --》 是ok的,证明服务没有问题

那是什么呢?--》防火墙

[root@localhost data]# systemctl stop firewalld.service #停止firewall
[root@localhost data]# systemctl disable firewalld.service #禁止firewall开机启动
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@localhost data]#

搞定ok!!!!

最新文章

  1. 使用tornado,我们可以做什么?
  2. espcms会员二次开发文件说明——会员,时间格式
  3. Brew Command Not Found
  4. ASP.NET MVC学习之视图篇(2)
  5. Technical notes fornight
  6. wap版和pc版的旋转js
  7. VMware 虚拟机安装 Mac OS X Mountain Lion 苹果系统
  8. oracle创建数据库表空间
  9. struts2 里escape="false"的问题?
  10. jquery datatable测试部分代码(仅自用)
  11. OPENQUERY (Transact-SQL)
  12. python中函数与函数式编程(二)
  13. MongoDB\BSON\UTCDateTime::toDateTime
  14. tomcat 虚拟目录
  15. [朴孝敏][Sketch]
  16. 树状数组+二分答案查询第k大的数 (团体程序设计天梯赛 L3-002. 堆栈)
  17. TP5报错variable type error: array
  18. selenium+Java,xpath定位方法详解(搬运留存)
  19. curl 命令返回json结构human readable
  20. [Training Video - 6] [File Reading] [Java] Read Properties file

热门文章

  1. BZOJ练习记
  2. C++面向对象程序设计学习笔记(5)
  3. 【oracle】ORA-12638 : 身份证明检索失败
  4. Regular Forestation CodeForces - 1252F(树同构)
  5. nwjs-打包
  6. Codeforces Round #549 (Div. 2) E 倍增处理按排列顺序的上一个位置
  7. 数据库多行数据合并一行(sqlserver、Oracle、Mysql)
  8. SpringBoot第十三篇:日志处理
  9. JAVA PTA 7-1 作品评分 (10 分)
  10. Java8 新特性 Stream() 创建流