title: How to install mongodb in Ubuntu?
body: <p>I am installing Mongodb in Ubuntu and get following error message : </p>
  
  <pre><code>ubuntu@ip-10-214-154-88:/var/lib/mongodb$ mongo
  MongoDB shell version: 3.0.0
  connecting to: test
  2015-10-26T11:45:14.257+0000 W NETWORK  Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
  2015-10-26T11:45:14.267+0000 E QUERY    Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed
      at connect (src/mongo/shell/mongo.js:179:14)
      at (connect):1:6 at src/mongo/shell/mongo.js:179
  exception: connect failed
  </code></pre>
  
  <p>I tried to solve this problem :</p>
  
  <pre><code>sudo rm /var/lib/mongodb/mongod.lock
  sudo service mongod restart
  </code></pre>
  
  <p>but above solution does not work for me.</p>
  
  <p>I also check space on server :</p>
  
  <pre><code>ubuntu@ip-10-214-154-88:/var/lib/mongodb$ df -h
  Filesystem      Size  Used Avail Use% Mounted on
  /dev/xvda1      7.8G  4.3G  3.1G  59% /
  none            4.0K     0  4.0K   0% /sys/fs/cgroup
  udev            1.9G   12K  1.9G   1% /dev
  tmpfs           377M  356K  377M   1% /run
  none            5.0M     0  5.0M   0% /run/lock
  none            1.9G     0  1.9G   0% /run/shm
  none            100M     0  100M   0% /run/user
  /dev/xvdb       3.9G  8.1M  3.7G   1% /mnt
  </code></pre>