接入MongoPlugin插件,连接mongo报错

如题。

接入代码:

MongoJFinalPlugin mongoPlugin = new MongoJFinalPlugin();

mongoPlugin.connectTimeout(10);

mongoPlugin.add((String) PropertiesPlugin.getParamMapValue(DictKeys.mongo_server),Integer.parseInt((String)PropertiesPlugin.getParamMapValue(DictKeys.mongo_port)))

.setDatabase((String) PropertiesPlugin.getParamMapValue(DictKeys.mongo_datebase))

.auth((String) PropertiesPlugin.getParamMapValue(DictKeys.mongo_user), (String) PropertiesPlugin.getParamMapValue(DictKeys.mongo_password))

.ssl().writeConcern();

me.add(mongoPlugin);

报错如下:

com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}. Client view of cluster state is {type=UNKNOWN, servers=[{address=121.199.69.248:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketWriteException: Exception sending message}, caused by {javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake}, caused by {java.io.EOFException: SSL peer shut down incorrectly}}]


评论区

eilir2016

2017-08-28 16:01

eilir2016

2017-08-29 17:48

JFinal

2017-08-29 19:53

连接超时,可能是 ip 地址、密码、用户名之类的不对,也或许防火墙屏蔽

mongo 没有用过,给不到具体帮助

热门反馈

扫码入社