Introduction to Big Data
Big Data
Volume
Variety
Velocity

Apache Hadoop
MapReduce
- Source data is divided among data nodes.
- Map phase generates key/value pairs.
- Reduce phase aggregates values for each key.
Introduction to Azure HDInsight

Creating an HDInsight Cluster
- Hadoop is the default and native implementation of Apache Hadoop.
- HBase is an Apache open-source NoSQL database built on Hadoop that provides random access and strong consistency for large amounts of unstructured data.
- Storm is a distributed, fault-tolerant, open-source computation system that allows you to process data in real-time.
This article uses the Hadoop cluster.
The next step is to add a cluster name, select the cluster size, add a password, select storage, and click on create HDInsight cluster.
Once the cluster has been created, its jobs and contents can be viewed by remote connection. To enable remote connection to the cluster, use the following procedure:


Enable Remote Desktop on the Cluster
- Click HDINSIGHT on the left pane. You will see a list of deployed HDInsight clusters.
- Click the HDInsight cluster that you want to connect to.
- From the top of the page, click CONFIGURATION.
- From the bottom of the page, click ENABLE REMOTE.
In the Configure Remote Desktop wizard, enter a user name and password for the remote desktop. Note that the user name must be different from the one used to create the cluster (admin by default with the Quick Create option). Enter an expiration date in the EXPIRES ON box.
To connect to the cluster via Remote Desktop Connection, in the portal, select your cluster and go to configuration and click connect.
An RDP file will be downloaded that shall be used to connect to the cluster. Open the file, enter the required credentials and click connect.
Once the Remote Connection is established, double-click the Hadoop Command Line icon.
This will be used to navigate through the Hadoop File System.
Once the command line is open, you may view all the files in the root folder.
The syntax to use is Hadoop fs followed by the Linux command used inside the Hadoop File System.

Accessing the Hadoop Cluster using Remote Desktop Connection

View files in the root directory
- hadoop fs - ls /

Browse to the Example folder
- hadoop fs -ls /example

Browse to Jars folder
- hadoop fs -ls /example/jars

View the sample data available
- hadoop fs -ls /example/data

Browse to Gutenberg folder
- hadoop fs -ls /example/data/gutenberg

Run MapReduce<
- hadoop jar hadoop-mapreduce-examples.jar wordcount /example/data/gutenberg/davinci.txt /example/results
- hadoop-mapreduce-examples.jar which is the compiled Java code used.
- wordcount is the method called from the jar file.
- /example/data/gutenberg/davinci.txt is the source data.
- /example/results is the folder where the result shall be stored.

View the result
- hadoop fs -tail /example/results/part-r-00000

Running MapReduce Jobs using PowerShell
Download and Install PowerShell
Connect PowerShell to a Microsoft Azure Account
- PS C:\> Get-AzurePublishSettingsFile
- PS C:\> Import-AzurePublishSettingsFile "FILE PATH \Visual Studio Ultimate with MSDN-4-29-2015-redentials.publishsettings"

Upload Data
- $storageAccountName = ""
- $containerName = "chervinehadoop"
- $localFolder = "K:\Wiki & Blog\Big Data Wikis\Intro\Upload"
- $destfolder = "UploadedData"
- $storageAccountKey = (Get-AzureStorageKey -StorageAccountName $storageAccountName).Primary
- $destContext = New-AzureStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey
- $files = Get-ChildItem $localFolder
- foreach($file in $files){
- $fileName = "$localFolder\$file"
- $blobName = "$destfolder/$file"
- write-host "copying $fileName to $blobName"
- Set-AzureStorageBlobContent -File $filename -Container $containerName -Blob $blobName -Context $destContext -Force
- }
- write-host "All files in $localFolder uploaded to $containerName!"


- JarFile "wasb:///example/jars/hadoop-mapreduce-examples.jar": The location of the Jar file containing the MapReduce code.
- ClassName "wordcount": The class to be used inside the Jar file.
- Arguments "wasb:///UploadedData", "wasb: ///UploadedData/output": Represents the Source and Destination folder respectively.
Once the definition of the job is created, the job is executed by the command Start-AzureHDInsightJob that takes as parameter the cluster name and the job definition.
- $clusterName = "ChervineHadoop"
- $jobDef = New-AzureHDInsightMapReduceJobDefinition -JarFile "wasb:///example/jars/hadoop-mapreduce-examples.jar" -ClassName "wordcount" -Arguments "wasb:///UploadedData", "wasb:///UploadedData/output"
- $wordCountJob = Start-AzureHDInsightJob –Cluster $clusterName –JobDefinition $jobDef
- Write-Host "Map/Reduce job submitted..."
- Wait-AzureHDInsightJob -Job $wordCountJob -WaitTimeoutInSeconds 3600
- Get-AzureHDInsightJobOutput -Cluster $clusterName -JobId $wordCountJob.JobId -StandardError

View the result


Conclusion
This article provided the basic concepts of Big Data before looking at some examples of how the Microsoft Azure platform can be used to solve big data problems. Using Microsoft Azure, it is not only easy to use and explore big data, but it is also easy to automate these tasks using PowerShell. Using the combination of Azure and PowerShell gives the user the possibility to automate the process completely from creating a Hadoop cluster to getting the results back.
See Also
References

Sr KarthigaPosted Mar 29, 2016, 8:51 AM
good one
Sr KarthigaPosted Mar 29, 2016, 8:51 AM
nice explanation
Abhishek JaiswalPosted Jul 20, 2015, 1:49 AM
Nice read, thanks for sharing!! :)
Rahul Kumar SaxenaPosted Jul 19, 2015, 9:50 AM
Good Show..
SharadPosted Jul 17, 2015, 3:55 AM
great efforts...
Nilesh JadavPosted Jul 16, 2015, 9:16 AM
Nice article sir
Yashwant VishwakarmaPosted Jul 14, 2015, 5:27 AM
Superb Article... Looking for more from you in future :-)
Sibeesh VenuPosted Jul 12, 2015, 8:21 AM
Nice share
Santhakumar MunuswamyPosted Jul 12, 2015, 12:03 AM
Great Article! Welcome....
Chervine BhiwooPosted Jul 11, 2015, 2:45 PM
Thanks Mahesh Chand. More articles about Azure/ Data Analytics to come in the near future :)
Mahesh ChandPosted Jul 11, 2015, 2:42 PM
Great work. Welcome to C# Corner. Need more experts on big data and Azure. Great to see this kind of article.
Gopi ChandPosted Jul 11, 2015, 1:24 PM
Excellent work
RakeshPosted Jul 11, 2015, 12:58 PM
Good one
Chervine BhiwooPosted Jul 11, 2015, 12:54 PM
Thanks mate!
Pankaj Kumar ChoudharyPosted Jul 11, 2015, 12:37 PM
Nice explain Sir......
Dinesh BeniwalPosted Jul 11, 2015, 11:55 AM
Thanks for sharing, welcome to C# Corner Chervine.