title: MongoDB 3.6 replica stuck on STARTUP
body: <p>I am using mongodb with two servers physically located in respectively Italy and France. </p>
  
  <p>The France server runs Ubuntu server is the Primary of the replica set, and works fine, i.e it accepts connections from mongo shell whether locally or remotely and is continuously updated by a python client.</p>
  
  <p>The second server in Italy works fine standalone with CentOS, but get stuck to STARTUP status when starting as part of the replica set. The log indicates that it received the configuration from the primary.</p>
  
  <p>I tried a several things to fix the issue but none of them works:</p>
  
  <ul>
  <li>Try to use keyfile (or not) between members of the replica set.</li>
  <li>Check the Firewall is open on both sides with nmap</li>
  <li>Add iptables rules to assert the mongodb port accept in/out traffic.</li>
  <li>Check mongod is up and listening on all IP on both sides.</li>
  <li>Configure (or not) the same admin user on secondary before restarting with --replSet. This step can only be done when secondary is standalone, since started as member of the replica set, it is stuck in transient state and thus it does not accept user creation. Hence it follows that login to the secondary fails.</li>
  </ul>
  
  <p>Also both members (France:primary and Italy:secondary) are started with --auth, --replSet rs0, --keyFile.</p>
  
  <p>I researched the issue on the web before, and found the closest answer here:
  <a href="https://stackoverflow.com/questions/36952564/monogodb-replica-set-status-not-changing-from-startup-to-secondary">MonogoDB Replica Set Status Not changing from Startup to Secondary</a></p>
  
  <p>But the author mention that the secondary did not received the configuration which makes the issue different than this one.</p>
  
  <p>Thanks for your help.</p>