zoukankan      html  css  js  c++  java
  • mongodb远程连接出现com.mongodb.MongoSocketOpenException: Exception opening socket的问题

    com.mongodb.MongoSocketOpenException: Exception opening socket???

        远程连接MongoDB出现连接不上的情况如下:

    Exception in thread "main" 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=[{address=192.168.142.198:27017,type=UNKNOWN,state=CONNECTING,exception={com.mongodb.MongoSocketOpenException: Exception opening socket}, caused by {java.net.ConnectException: Connection refused: connect}}] com.mongodb.connection.BaseCluster.createTimeoutException(BaseCluster.java:369)com.mongodb.connection.BaseCluster.selectServer(BaseCluster.java:101)com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource.(ClusterBinding.java:75)com.mongodb.binding.ClusterBinding$ClusterBindingConnectionSource(ClusterBinding.java:71)com.mongodb.binding.ClusterBinding.getWriteConnectionSource(ClusterBinding.java:68)com.mongodb.operation.CommandOperationHelper.executeWrappedCommandProtocol(CommandOperationHelper.java:158)com.mongodb.operation.

    解决方法:将配置文件mongodb.conf中,bind_id=127.0.0.1改为bind_id=0.0.0.0  再重启服务

  • 相关阅读:
    oracl遇到的问题
    Ubuntu安装pyucharm的专业版本
    android adb logcat详解(三)
    android monkey压力测试(二)
    android adb常用命令(一)
    python *args 与 **kwargs
    python中带有下划线的变量和函数
    如何区分Python package
    Python Importlib.import_module动态导入模块
    python os.path.dirname(__file__)
  • 原文地址:https://www.cnblogs.com/afeiiii/p/15164000.html
Copyright © 2011-2022 走看看