mongos
如果配置服务器不可用,我正在尝试快速启动和失败。现在,由于配置服务器不可用,我看到:
Tue Feb 12 11:09:13 [mongosMain] can't resolve DNS for [compute-1-3] sleeping and trying 10 more times
如何配置10
?
mongos
如果配置服务器不可用,我正在尝试快速启动和失败。现在,由于配置服务器不可用,我看到:
Tue Feb 12 11:09:13 [mongosMain] can't resolve DNS for [compute-1-3] sleeping and trying 10 more times
如何配置10
?
10 次重试是硬编码的,不可配置。你可以在这里看到它:
https://github.com/mongodb/mongo/blob/master/src/mongo/s/config.cpp#L742
以防万一行号发生变化,这是相关的计数器/循环:
for ( int x=10; x>0; x-- ) {
if ( ! hostbyname( host.c_str() ).empty() ) {
ok = true;
break;
}
log() << "can't resolve DNS for [" << host << "] sleeping and trying " << x << " more times" << endl;
sleepsecs( 10 );
因此,理论上您可以更改代码并重新构建自己,但是您必须为新版本维护它。相反,我建议您保持配置服务器可用,或者至少在 mongos 启动后约 100 秒内启动它。