Installing Maven on Windows 7


Tools Used:

  1. JDK 1.6
  2. Maven 3.1.1
  3. Windows 7

Step 1: Install Java if not already installed

 Install Java and add/update the JAVE_HOME variable


Step 2: Download Maven

Choose a version and download apache-maven-* file from here

Step 3: Extract It

Extract the downloaded zip file into desired location.

Step 4: Add MAVEN_HOME

Now, set the MAVEN_HOME variable just as you did for JAVA_HOME variable.


Step 5: Update Path variable

Append up to bin folder path in variable value, so that you can run the Maven’s command everywhere.


Step 6: Verify installation

Open command prompt. Type mvn –version in command prompt and hit enter.


If you see similar output as above, means your Apache Maven is installed successfully J



SafeModeException: Name node is in safe mode


org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/...../test. Name node is in safe mode.

In order to forcefully let the namenode leave safemode, following command should be executed:

$ bin/hadoop dfsadmin -safemode leave

-safemode isn’t a sub-command for hadoop fs, but it is of hadoop dfsadmin.

Run following command so that any inconsistencies in the hdfs might be sorted out.

$ hadoop fsck


Namenode not starting

I was using Hadoop in a pseudo-distributed mode and everything was working fine. But when I restarted my computer I can’t start Namenode. Only way I can start Namenode is by formatting it and I end up losing data in HDFS.

  • Make following changes to start Namenode 

In conf/hdfs-site.xml, you should have a property like





The property “” allow you to control where Hadoop writes NameNode metadata. And giving it another dir rather than /tmp makes sure the NameNode data isn’t being deleted when you reboot.

Format Namenode after you change it

$ bin/hadoop namenode -format

$ bin/hadoop


Pig Installation on Ubuntu

pigExecution Modes

Pig has two execution modes :

  • Local Mode – To run Pig in local mode, you need access to a single machine; all files are installed and run using your local host and file system. Specify local mode using the -x flag (pig -x local).
  • MapReduce Mode – To run Pig in MapReduce mode, you need access to a Hadoop cluster and HDFS installation. MapReduce mode is the default mode; you can, but don’t need to, specify it using the -x flag (pig OR pig -x mapreduce).

The pig-0.11.1 installation is done in below versions of Linux and Hadoop respectively.


HADOOP 1.1.2

I have hduser as a dedicated hadoop system user. I had installed my Hadoop in /home/hduser/hadoop folder. Now I am going to install pig in /usr/lib/pig folder.

  • Download Pig from here.
  • Enter into the directory where the stable version is downloaded. By default it downloads in “Downloads” directory.
$ cd Downloads/
  • Unzip the tar file.
$ tar -xvf pig-0.11.1.tar.gz
  • Create directory
$ sudo mkdir /usr/lib/pig
  • move pig-0.11.1 to pig
$ mv pig-0.11.1 /usr/lib/pig/
  • Set the PIG_HOME path in bashrc file

To open bashrc file use this command

$ gedit ~/.bashrc

 In bashrc file append the below 2 statements

export PIG_HOME=/usr/lib/pig/pig-0.11.1
export PATH=$PATH:$PIG_HOME/bin
  • Restart your computer or use [ . .bashrc]

Now let’s test the installation

On the command prompt type

$ pig -h

It shows the help related to Pig, and its various commands.

  • Starting pig in local mode
 $ pig -x local grunt>
  •  Starting pig in mapreduce mode
 $ pig -x mapreduce


 $ pig


Note:The information provided here is best of my knowledge and experience if at all any modifications are to be made please help me with your valuable suggestion which are always welcome…. :)

How to add RevolverMaps Widget to your Blog /Website


This widget displays all visitor locations as well as recent hits with city, state and country information live and in real time. A click on the enlarge button opens the live statistics page.

Go to the site and click on “Get Standard Version”.

Customise the look of your globe by changing Globe, Dimensions, Colors and Advanced Settings to suit your tastes by clicking on the round button


Copy the code from step number 5 [Copy The Code Your Site…]

  •  How to add a widget to

Login to your WordPress account

  1. Go to ‘My Blog’ – ‘Dashboard’ – ‘Appearance’ – ‘Widgets’
  2. Drag the Element ‘Text – Arbitrary text or HTML’ to the sidebar
  3. Copy the code from the RevolverMaps setup page to the big textbox, optionally add a title
  4. Click on save, you’re done.
  • How to add a widget to a ( layout?

Login to your Blogger-account

  1. Choose your blog on the dashboard, click on ‘Layout’. You get an overview of the page elements on your blog.
  2. Click on one of the ‘Add a Gadget’ links, a pop-up opens
  3. Under ‘Basics’ click on ‘HTML/JavaScript’
  4. Paste the code you get at into ‘Content’, optionally add a title
  5. Click on ‘SAVE’
  6. Drag the new page element representing the widget to a position of your choice
  7. Click on ‘PREVIEW’, check if the widget fits into your layout. You may have to experiment a little in order to find appropriate size settings for the widget.
  8. Click on ‘SAVE’, you’re done
  •   How to add a widget to Website?

Copy the code from the RevolverMaps setup page into your web page html code.


Happy bloging 🙂

Install MongoDB on Ubuntu

MongoDB is an open-source document database, and the leading NoSQL database. Written in C++.

This example is using MongoDB 2.4.6, running on Ubuntu13.4, both MongoDB client and server console are run on localhost, same machine.

  • Download MongoDB from here.
  • Enter into the directory where the MongoDB is downloaded. By default it downloads in “Downloads” directory
$ cd Downloads/
  • Unzip the tar file.
$ tar xzf mongodb-linux-i686-2.4.6.tgz
  • Move mongodb-linux-i686-2.4.6 to mongodb
$ sudo mkdir /usr/lib/mongodb

$ sudo mv mongodb-linux-i686-2.4.6 /usr/lib/mongodb/

  • Before you start mongod for the first time, you will need to create the data directory. By default, mongod writes data to the /data/db/ directory. To create this directory, and set the appropriate permissions use the following commands:
# mkdir -p /data/db

# chmod 777 /data/*

1st command prompt: Start mongodb server

$ cd /usr/lib/mongodb/mongodb-linux-i686-2.4.6/bin/

$ ./mongod


2nd command prompt: Start the client

$ cd /usr/lib/mongodb/mongodb-linux-i686-2.4.6/bin/

$ ./mongo




Note: The information provided here is best of my knowledge and experiences if at all any modifications are to be made please help me with your valuable suggestions which are always welcome…. :)