mongo链接不上Timed out after 30000

 

 

 

 

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

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= ...............................

 

系统: mongodb

  centos7, 64位centos

  mongo,mongodb-linux-x86_64-rhel70-4.0.10测试

解压,进入bin,启动centos7

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

 

报错了spa

 

为何呢?code

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

 

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

 

[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!!!!get

相关文章
相关标签/搜索