title: Installed mongodb on AWS EC2 instance but unable to connect to it
body: <p>I have installed MongoDB on EC2 Amazon Linux instance. I have set the security group in the way the port SSH 22 and TCP 27017 are opened. Unfortunately when I try to connect executing the command from the ssh console </p>
  
  <pre><code>mongo &lt;public-dns-name&gt;:27107/test
  </code></pre>
  
  <p>I get the following error</p>
  
  <pre><code>connecting to: &lt;public-dns-name&gt;:27017/test
  2014-08-09T15:25:07.966+0000 warning: Failed to connect to xxx.xx.xx.xx:27017, reason: errno:111 Connection refused
  2014-08-09T15:25:07.967+0000 Error: couldn't connect to server &lt;public-dns-name&gt;:27017 (172.31.19.26), connection attempt failed at src/mongo/shell/mongo.js:148
  exception: connect failed
  </code></pre>