简体   繁体   English

在MongoDB监控服务中使用SSL时出错

[英]Error in using Using SSL with MongoDB Monitoring Service

I did edit the settings.py file in my agent installation from the help of http://mms.10gen.com/help/single/index.html#mms-requirements so that the useSslForAllConnections value is True Now when i run python agent.py I get error like this 我在http://mms.10gen.com/help/single/index.html#mms-requirements的帮助下编辑了我的代理程序安装中的settings.py文件,以便useSslForAllConnections value is True现在我运行python代理程序时.py我得到这样的错误

2012-12-19 15:09:37,209 ERROR Problem collecting non-blocking data from: gobingoo:27017 - exception: Traceback (most recent call last):
  File "/home/prem/mms-agent/nonBlockingStats.py", line 56, in run
    monitorConn = self.mmsAgent.getDbConnection( self.hostKey )
  File "/home/prem/mms-agent/mmsAgent.py", line 109, in getDbConnection
    return pymongo.Connection( hostDef['mongoUri'] , slave_okay=True, ssl=True )
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.4.1-py2.7-linux-x86_64.egg/pymongo/connection.py", line 180, in __init__
    max_pool_size, document_class, tz_aware, _connect, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pymongo-2.4.1-py2.7-linux-x86_64.egg/pymongo/mongo_client.py", line 274, in __init__
    raise ConnectionFailure(str(e))
ConnectionFailure: SSL handshake failed. MongoDB may not be configured with SSL support.

What is the reason behind this.. 这背后的原因是什么..

The problem is that you are not using SSL connections with MongoDB: http://docs.mongodb.org/manual/administration/ssl/ 问题是您没有使用与MongoDB的SSL连接: http//docs.mongodb.org/manual/administration/ssl/

Since this is not the case and you have turned it on in your agent MMS attempts to do a SSL handshake with the MongoDB cluster and fails. 由于情况并非如此,并且您已在代理中将其启用,因此MMS会尝试与MongoDB群集进行SSL握手并失败。

You should set this flag within your agent settings file to false since you do not use SSL connections in your MongoDB cluster. 您应该在代理设置文件中将此标志设置为false,因为您不在MongoDB集群中使用SSL连接。

The setting you talk about is a specific subset for a certain scenario: http://mms.10gen.com/help/single/index.html#using-ssl-with-mms one which does not apply to you. 您谈到的设置是特定场景的特定子集: http//mms.10gen.com/help/single/index.html#using-ssl-with-mms一个不适用于您的场景。

Just to note, I have a full cluster running, with MMS monitoring right now and everything is running SSL, so I can confirm it works. 需要注意的是,我有一个完整的集群运行,现在有MMS监控,一切都运行SSL,所以我可以确认它有效。 However, I enabled each host as SSL enabled individually rather than altering the agent config and restarting. 但是,我将每个主机启用为单独启用SSL,而不是更改代理配置并重新启动。 That is, method 2 here: 也就是说,方法2在这里:

http://mms.10gen.com/help/single/index.html#using-ssl-with-mms http://mms.10gen.com/help/single/index.html#using-ssl-with-mms

You may want to try that invdividual setting just in case 您可能想尝试这种不同的设置以防万一

To test things out first, try using the mongo shell to connect to each member of the set from the host you are running the agent, with SSL and verify that the connection succeeds: 要先测试一下,请尝试使用mongo shell从运行代理的主机连接到该组的每个成员,使用SSL并验证连接是否成功:

/path/to/mongo --ssl --host --port / path / to / mongo --ssl --host --port

If that succeeds, you have verified that the agent should be able to connect, and that your MongoDB set up is working. 如果成功,您已验证代理应该能够连接,并且您的MongoDB设置正在运行。 It would probably be a good idea at that point to file an MMS issue in Jira to troubleshoot further: 那时在Jira中提交MMS问题以进一步排除故障可能是一个好主意:

https://jira.mongodb.org/browse/MMS https://jira.mongodb.org/browse/MMS

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM