MongoS分片元数据管理器无法请求实例手动重置

时间:2016-05-02 12:48:50

标签: mongodb sharding

我的MongoS服务器并不盯着他们在日志中发送此错误。

  

SHARDING [Balancer]在进行平衡时捕获异常:服务器   分片元数据管理器无法初始化并将保留   这个状态直到实例被手动重置::由::引起   HostNotFound:无法解析主机confserv_1.xyz.com的DNS

2016-05-02T17:57:06.612+0530 I SHARDING [Balancer] about to log metadata event into actionlog: { _id: "DB2255-2016-05-02T17:57:06.611+0530-5727479aa1051c5fb04fcc49", server: "mongoS1", clientAddr: "", time: new Date(1462192026611), what: "balancer.round", ns: "", details: { executionTimeMillis: 35, errorOccured: true, errmsg: "Server's sharding metadata manager failed to initialize and will remain in this state until the instance is manually reset :: caused by :: HostNotFoun..." } }  

当我使用主机名连接配置服务器时,它工作正常 我试图重启MongoS服务器它没有出现。

我检查了Mongo代码,发现了这个错误 https://github.com/mongodb/mongo/blob/master/src/mongo/db/s/sharding_state.cpp

/ TODO: remove after v3.4.
// This is for backwards compatibility with old style initialization through metadata
// commands/setShardVersion. As well as all assignments to _initializationStatus and
// _setInitializationState_inlock in this method.
if (_getInitializationState() == InitializationState::kInitializing) {
    auto waitStatus = _waitForInitialization_inlock(deadline, lk);
    if (!waitStatus.isOK()) {
        return waitStatus;
    }
}

if (_getInitializationState() == InitializationState::kError) {
    return {ErrorCodes::ManualInterventionRequired,
            str::stream() << "Server's sharding metadata manager failed to initialize and will "
                             "remain in this state until the instance is manually reset"
                          << causedBy(_initializationStatus)};
}  

但它没有提到需要什么手动干预。 目前的Mongo版本是3.2.6

1 个答案:

答案 0 :(得分:0)

我在尝试加强安全配置时遇到了这个问题。在您的情况下,我能够从所有mongos实例连接到配置服务器。

在我的情况下,我也在测试一个案例,副本集的成员位于不同的数据中心,我只是在steppingDown一些初选之后才遇到问题。

我最后注意到,不是因为错误消息假装,问题发生在一个数据中心的一些初选中,他们无法路由回配置服务器。修复路由问题(最终/ etc / hosts)后,mongo端不再出现问题。