连接mongodb与replicaset-Bitnami时出错

时间:2017-11-21 06:43:59

标签: mongodb azure bitnami

我已经在Azure上使用replicaset部署了bitnam MongoDB并且我没有改变任何东西,但是当我尝试使用连接字符串连接MongoDB时,我收到了像`

这样的错误
Connection failed.

SERVER [xyz.southeastasia.cloudapp.azure.com:27017] (Type: UNKNOWN) 
|_/ Connection error (MongoSocketReadTimeoutException): Timeout while receiving message
|____/ I/O error: Read timed out

Details:
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=xyz.southeastasia.cloudapp.azure.com:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoSocketReadTimeoutException: Timeout while receiving message}, caused by {java.net.SocketTimeoutException: Read timed out}}]

我已经运行了bitnami mongodb和azure上的replicaset,这是在那个时候创建​​的,那个时候我还没有遇到过这个问题。

1 个答案:

答案 0 :(得分:0)

在我看来,地址可能已经改变。我建议您确认xyz.southeastasia.cloudapp.azure.com仍指向您要连接的同一IP地址。还要检查是否没有阻止流量的防火墙规则。