IBMCloud-如何连接到MongoDB? [英] IBMCloud - How can I connect to MongoDB?

查看:65
本文介绍了IBMCloud-如何连接到MongoDB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在IBMCloud实例中连接到MongoDB,并且正在使用MongoID.我曾经使用过一些配置并尝试了很多东西.我遇到了错误:

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

这是我要连接到mongoDB的mongoid.yml:

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

我需要添加什么才能与IBMCloud中的mongo数据库连接?

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

推荐答案

系统库"来自OpenSSL,表明CA证书存在问题,例如路径未引用现有文件.请注意,在配置中,您指定了可能导致问题的相对路径.

"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.

我创建了 https://jira.mongodb.org/browse/RUBY-1946将异常类添加到所报告的消息中,以澄清将来错误的出处.

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.

升级到当前版本的Ruby驱动程序(在撰写本文时为2.10.2),该驱动程序提供了更广泛的诊断功能.设置驱动程序日志级别以进行调试( https://docs.mongodb. com/mongoid/master/tutorials/mongoid-configuration/#logging ).如果您无法确定问题所在,请发布 在此处更新了错误和日志消息.

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.

这篇关于IBMCloud-如何连接到MongoDB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆