MongoDB监控服务身份验证

时间:2013-06-16 11:28:06

标签: mongodb authentication monitoring database-replication sharding

我有一个分片的mongodb群集,2个分片,每个分片是一个3服务器副本集。 所有服务器都在aws-vpc中,而keyFile没有auth选项, 只有mongos服务器具有ip和外部访问权限,并且具有auth选项。 我在mongos服务器上安装了10gen MMS服务,并确定了我所有的服务器 但它开始向日志抛出错误:

Problem collecting blocking data from (check if it is up and DNS): 10.0.1.150:27017 -
exception: Traceback (most recent call last): File "/root/mms-agent/blockingStats.py",
line 81, in _collectBlockingStats stats = self._collectStats( passes, monitorConn ) File
"/root/mms-agent/blockingStats.py", line 175, in _collectStats root['serverStatus'] = 
monitorConn.admin.command( 'serverStatus' ) File "/usr/lib/python2.6/site-
packages/pymongo-2.5.2-py2.6-linux-x86_64.egg/pymongo/database.py", line 393, in
command msg, allowable_errors) File "/usr/lib/python2.6/site-packages/
pymongo-2.5.2-py2.6-linux-x86_64.egg/pymongo/helpers.py", line 147, in 
_check_command_response raise 
OperationFailure(msg % errmsg, code) OperationFailure: command SON([('serverStatus', 1)]) 
failed: unauthorized

我试图添加

globalAuthUsername = """MY_USER"""

globalAuthPassword = """MY_PASS"""

但它仍然会抛出此错误,有点不同

Problem collecting blocking data from: 10.0.1.150:27017 - exception: Traceback (most 
recent call last): File "/root/mms-agent/blockingStats.py", line 57, in run monitorConn = 
self.mmsAgent.getDbConnection( self.hostKey ) File "/root/mms-agent/mmsAgent.py",
line    107,
in getDbConnection return pymongo.Connection( hostDef['mongoUri'] , slave_okay=True, 
document_class=bson.son.SON ) File "/usr/lib/python2.6/site-packages/pymongo-2.5.2-py2.6-
linux-x86_64.egg/pymongo/connection.py", line 220, in __init__ max_pool_size, 
document_class, 
tz_aware, _connect, **kwargs) File "/usr/lib/python2.6/site-packages/pymongo-2.5.2-py2.6-
linux-x86_64.egg/pymongo/mongo_client.py", line 355, in __init__ raise 
ConfigurationError(str(exc)) ConfigurationError: command SON([('authenticate', 1),
('user', u'root'), ('nonce', u'523396ae8ef27d70'), ('key',
u'ce27e3fa05186bd1b7d3594cd3efb00f')]) failed: auth fails

任何想法?

1 个答案:

答案 0 :(得分:1)

找到答案......所有实例都必须有用户名并通过身份验证