mongo连接不上Timed out after 30000
生活随笔
收集整理的這篇文章主要介紹了
mongo连接不上Timed out after 30000
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
?
?
?
本地連接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!!!!
?
轉載于:https://www.cnblogs.com/renfanzi/p/10998844.html
《新程序員》:云原生和全面數字化實踐50位技術專家共同創作,文字、視頻、音頻交互閱讀總結
以上是生活随笔為你收集整理的mongo连接不上Timed out after 30000的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: MYSQL的一些常用函数
- 下一篇: Unity 之事件系统