本地鏈接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