Install MongoDB on Ubuntu


Step by step instruction to install MongoDB on Ubuntu based on: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/

Install MongoDB

Configure Package Management System (APT)

The Ubuntu package management tool (i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys. Issue the following command to import theMongoDB public GPG Key:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
1
sudo apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv 7F0CEB10

 

Create a /etc/apt/sources.list.d/mongodb.list file using the following command.

echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

Create a folder to install ubuntu

Now issue the following command to reload your repository:

sudo apt-get update

sudo apt-get update

Install Packages

Issue the following command to install the latest stable version of MongoDB:

sudo apt-get install mongodb-10gen

sudo apt-get install mongodb-10gen

 

When this command completes, you have successfully installed MongoDB! Continue for configuration and start-up suggestions.

mongodb-in-ubuntu-vagrant
mongodb-in-ubuntu-vagrant

 

Advertisements

Installing Vagrant on Windows 7 and 8


How to install Vagrant on Windows and run using VirtualBox?

Based on the instructions from http://www.seascapewebdesign.com/blog/part-1-getting-started-vagrant-windows-7-and-8   , I am in the process of installing Vagrant on Windows 7. In this tutorial, we will be installing Vagrant, a bare bones server with Ubuntu installed. Vagrant is a server that runs under VirtualBox. You will need to have VirtualBox installed. You will also need to have Putty installed in order to access your new Vagrant server via SSH. These instructions also apply to Windows 8. Requirements: A hard connection to the Internet Putty needs to be installed. http://www.putty.org/ VirtualBox needs to be installed.

1. Download and install the most recent VirtualBox for Windows from https://www.virtualbox.org/wiki/Downloads

2. Setup new Virtual Machine In Virtual Box

3.  Download and install the latest version of Vagrant from http://downloads.vagrantup.com.
Steps are very simple and once the installation complete this is what you will see in C:\

vagrant_installation_folder

4. Setup Vagrant in Windows 7/8

Change directory to C:\HashiCorp\vagrant\bin

Then type the following commands:

C:\HashiCorp\vagrant\bin> vagrant box add lucid32 http://files.vagrantup.com/lucid32.box

vagrant_command
vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
added_virtualbox
Successfully added Box ‘Lucid32″ for “Virtualbox”

C:\HashiCorp\vagrant\bin> vagrant init lucid32

A `Vagrantfile` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on`vagrantup.com` for more information on using Vagrant.

vagrant_init_lucid32
A `Vagrantfile` has been placed in this directory

C:\HashiCorp\vagrant\bin> vagrant up

C:\HashiCorp\Vagrant\bin>vagrant up
Bringing machine ‘default’ up with ‘virtualbox’ provider…
==> default: Importing base box ‘lucid32’…
==> default: Matching MAC address for NAT networking…
==> default: Setting the name of the VM: bin_default_1396737444370_66404
==> default: Clearing any previously set network interfaces…
==> default: Preparing network interfaces based on configuration…
default: Adapter 1: nat
==> default: Forwarding ports…
default: 22 => 2222 (adapter 1)
==> default: Booting VM…
==> default: Waiting for machine to boot. This may take a few minutes…
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key

Vagrant Up
Vagrant Up

 5. Open VirtualBox . Vagrant setup Ubuntu virtual machine in three line of command.

vagrant_virtulbox

Very powerful and easy to setup Virtual Machine using Vagrant

 

6. Now let’s connect to Vagrant build virtual machine using putty

Open Putty and enter the following information.  When I installed I got IP address of 127.0.0.1 with port 2222

connect-vagrant-virtul-box-using-putty
connect-vagrant-virtul-box-using-putty

 

You may get puTTY security Alert, click “Yes”

connect-vagrant-virtual-machine-using-putty

The server’s host key is not cached in the registry. You have to guarantee that the server is computer you think it is.
If you trust this host, hit yes to add the key to PuTTy’s cache and carry on connecting.
If you want to carry on connecting just once, without adding the key to the cache, hit NO. If you do not trust this host, hit Cancel to abandon the connection.

7. Enter username: vagrant and Password: vagrant

Welcome to your Vagrant-built virtual machine.
Last login: Fri Sep 14 07:26:29 2012 from 10.0.2.2

vagrant-built-virtual-machine
vagrant-built-virtual-machine

vagrant-built-virtual-machine is ready 

 

Creating new box using vagrantcloud


Enter Name, Short Description and Description and click create box

Create a box in vargant
Create a box in vargant

2. Select the version

create_new_version_vagrantcloud

3. Select the provider name
Vagrant will need to know how to use this provider. virtualboxvmware_desktop and aws are examples of core providers.

new_provider_vagrantcloud

Enter AWS URL and click Create Provider

Learn how to create effective Vagrant development environments


A practical guide to Vagrant

Learn how to create effective Vagrant development environments
What to expect from this book:

As a very practical guide, this book will cover Vagrant from the requirements and installation to
slightly complex tasks, such as running multiple VMs and deploying “real” servers. It will walk
you through the most used Vagrant provisioners – Puppet, Chef and Ansible – showing their main
characteristics and a quick guide to get you started.

This book will also cover some important pro tips to create your Vagrant projects; and finally, a
collection of recipes for common provisioner tasks, such as installing packages, using templates,
running commands etc.

Vagrant Cookbook is updated to cover the most important new features from Vagrant 1.5. It targets
beginner to intermediate users, also serving as a quick reference for provisioners (Ansible, Puppet
and Chef) and how to improve your current Vagrant setups.


Vagrant Cloud and Vagrant Share


An overview of new features from Vagrant 1.5 – Vagrant Cloud and Vagrant Share, including some security tips to avoid unauthorized access to your shared VMs.