我有一个分片的mongodb集群,2个分片,每个分片是3个服务器的副本集。所有服务器都在aws-vpc中,并使用不带身份验证选项的keyFile,只有mongos服务器具有ip和外部访问权限,并且具有身份验证选项。我在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有什么想法吗?
发布于 2013-06-16 20:34:08
找到答案了。所有实例必须具有用户名并通过身份验证
https://stackoverflow.com/questions/17132807
复制相似问题