Linux centos7连接mongodb错误 查看和关闭防火墙

错误现象 :

Cluster description not yet available. Waiting for 30000 ms before timing out

Exception in monitor thread while connecting to server 192.168.13.137:27017

com.mongodb.MongoSocketOpenException: Exception opening socket

Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=192.168.13.137:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: connect timed out}}]; nested exception is com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting to connect. Client view of cluster state is {type=UNKNOWN, servers=[{address=192.168.13.137:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.SocketTimeoutException: connect timed out}}]

在这里插入图片描述

解决方案 :

查看防火墙状态

sudo firewall-cmd --state

在这里插入图片描述

停止firewall

sudo systemctl stop firewalld.service

在这里插入图片描述

禁止firewall开机启动

sudo systemctl disable firewalld.service 

在这里插入图片描述

Guess you like

Origin blog.csdn.net/qq_44226094/article/details/115760977