title: mongoDB, connection refused
body: <p>Show my code</p>
  
  <pre><code>conf.set( "mongo.input.uri" , "mongodb://127.0.0.1/stackoverflow.mrtest" );
  conf.set( "mongo.output.uri" , "mongodb://127.0.0.1/stackoverflow.mrtest_out2" );
  </code></pre>
  
  <p>the code runs without error when the host is <code>localhost</code> or <code>127.0.0.1</code>. But when the host changed to my ip wlan0 <code>192.168.1.102</code>, it returned the following error</p>
  
  <pre><code>Cluster created with settings {hosts=[192.168.1.102:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
  Exception in monitor thread while connecting to server 192.168.1.102:27017
  com.mongodb.MongoSocketOpenException: Exception opening socket
      at com.mongodb.connection.SocketStream.open(SocketStream.java:63)
      at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:114)
      at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:127)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.net.ConnectException: connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      at java.net.Socket.connect(Socket.java:589)
      at com.mongodb.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:50)
      at com.mongodb.connection.SocketStream.open(SocketStream.java:58)
      ... 3 more
  </code></pre>
  
  <p>I have open the port 27017.</p>
  
  <pre><code>sudo iptables -A INPUT -ptcp --dport 27017 -j ACCEPT
  </code></pre>
  
  <p>My OS is Ubuntu 14.04.</p>
  
  <p>How should I fix it? Thank you!</p>