title: How to initialize mongodb replication set without calling rs.initiate()?
body: <p>I am trying to initiate mongod with replSet=1 as below:
  $mongod --dbpath /x/y --replSet 1</p>
  
  <p>But I kept getting errors like "you need to initialize the replication set by calling rs.initiate()", then I start a mongo shell to issue rs.initiate() and the problem gets resolved. </p>
  
  <p>But my question is why a separate mongo shell is needed? Is there a way to do it using mongod option?</p>