title: Mongo on Linux, From Java App, throwing Exception can't find a master
body: <p>I am running MongoDb before on Windows and my Java app was connecting perfectly. Now I switch the MongoDb to Linux, and started simply as "./mongod". But whenever I try to connect to Mongo, I got the following exception. </p>
  
  <pre><code>Caused by: com.mongodb.MongoException: can't find a master
      at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:434)
      at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:209)
      at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:305)
      at com.mongodb.DBCollection.findOne(DBCollection.java:647)
      at com.mongodb.DBCollection.findOne(DBCollection.java:626)
      at com.mongodb.DBApiLayer$MyCollection.createIndex(DBApiLayer.java:364)
      at com.mongodb.DBCollection.createIndex(DBCollection.java:436)
      at com.mongodb.DBCollection.ensureIndex(DBCollection.java:515)
      at com.google.code.morphia.DatastoreImpl.ensureIndex(DatastoreImpl.java:245)
      at com.google.code.morphia.DatastoreImpl.ensureIndexes(DatastoreImpl.java:310)
      at com.google.code.morphia.DatastoreImpl.ensureIndexes(DatastoreImpl.java:279)
      at com.google.code.morphia.DatastoreImpl.ensureIndexes(DatastoreImpl.java:340)
      at com.google.code.morphia.DatastoreImpl.ensureIndexes(DatastoreImpl.java:333)
  </code></pre>