0

我有一个 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

有任何想法吗?

4

1 回答 1

1

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

于 2013-06-16T12:34:08.350 回答