title: mongo DB - All nodes secondary
body: <p>All of the nodes in our cluster are "secondary" and no node is stepping up as "primary".</p>
  
  <p>How do I force a node to become primary?</p>
  
  <p>===SOLUTION===
  We had 4 nodes in our replica set, when we are supposed to only have an odd number of nodes.  </p>
  
  <ol>
  <li><p>Remove a node so you have an odd number of nodes</p>
  
  <ul>
  <li>rs.config()</li>
  </ul>
  
  <p>Edit the list of servers in notepad/textpad removing one of the servers</p>
  
  <ul>
  <li><p>config = POST_MODIFIED_LIST_HERE </p></li>
  <li><p>rs.reconfig(config, {force:true})</p></li>
  </ul></li>
  <li><p>Stop the mongodb service 'mongod' on all nodes, and bring them back up</p></li>
  <li>Done</li>
  </ol>
  
  <p>If this doesn't fix it, try adding a priority to one of the nodes.</p>