title: mongodb replicaset auth not working
body: <p>I have a problem with replica sets</p>
  
  <p>After I add keyFile path to mongodb.conf I can connect, this is my mongo.conf:</p>
  
  <pre><code>logpath=/path/to/log
  
  logappend=true
  
  replSet = rsname
  
  fork = true
  
  keyFile = /path/to/key
  </code></pre>
  
  <p>And this is what is showed in the command line:</p>
  
  <pre><code>XXXX@XXXX:/etc$ sudo service mongodb restart
  stop: Unknown instance:
  mongodb start/running, process 10540
  XXXX@XXXX:/etc$ mongo
  MongoDB shell version: 2.4.6
  connecting to: test
  Mon Sep 30 18:44:20.984 Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145
  exception: connect failed
  XXXX@XXXX:/etc$
  </code></pre>
  
  <p>if I comment the keyFile line in mongo.conf it works fine.</p>