IBMCloud - How can I connect to MongoDB?

≡放荡痞女 提交于 2019-12-24 22:33:35

问题


I'm trying to connect to MongoDB in a IBMCloud instance and I'm using MongoID. I ever use some configurations and try very things. I'm getting the error:

MONGODB | Error running ismaster on address:port: system lib

Here is my mongoid.yml that I'm trying to connect to mongoDB:

development:
  clients:
    default:
      database: databasename
      hosts:
        - address:port
        - address:port
      options:
        user: 'admin'
        password: 'some-password'
        auth_mech: :scram
        auth_source: admin
        connect: :replica_set
        replica_set: replset
        ssl: true
        ssl_ca_cert: ./some-certificate.pem
        ssl_verify: true
  options:
    log_level: :debug

What do I need to add to connect with the mongo database in IBMCloud?


回答1:


"system lib" is coming from OpenSSL and indicates a problem with the CA certificate, such as the path not referring to an existing file. Note that in the configuration you specified a relative path which could cause problems.

I created https://jira.mongodb.org/browse/RUBY-1946 to add the exception class to the reported message which would clarify where the error is originating in the future.

Upgrade to the current version of Ruby driver (2.10.2 as of this writing) which provides more extensive diagnostics. Set driver log level to debug (https://docs.mongodb.com/mongoid/master/tutorials/mongoid-configuration/#logging). If you are having trouble identifying the problem then, post the updated error and log messages here.



来源:https://stackoverflow.com/questions/58053353/ibmcloud-how-can-i-connect-to-mongodb

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!