2013-02-12 65 views
1

我試圖啓動mongos,並且如果配置服務器不可用,則會快速失敗。眼下,隨着不可用的配置服務器,我看到:配置mongos啓動時配置服務器重試次數?

Tue Feb 12 11:09:13 [mongosMain] can't resolve DNS for [compute-1-3] sleeping and trying 10 more times

如何配置10

回答

1

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秒內完成。