Friday 22 January 2016

Cannot change directory in Windows cmd

cd /d F:\Python3\Scripts

This should work ! :)

NUMPY installation Error using PIP:

https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy


Wednesday 13 January 2016

Delete Script HDInsight Cluster

Login-AzureRmAccount
Import-AzurePublishSettingsFile "F:\Microsoft Azure Sponsorship-12-16-2015-credentials (2).publishsettings"
Get-AzureRmSubscription  # list your subscriptions and get your subscription ID
$subscriptionName="Microsoft Azure Sponsorship"
#Select-AzureRmSubscription -SubscriptionId "<Your Azure Subscription ID>"
Select-AzureRmSubscription -SubscriptionName $subscriptionName

$resourceGroupName = "hdinsight_southeastasia"

$storageAccountName = "XXXXXXXXXX"
$containerName = "XXXXXXXXXXX"

$clusterName = "XXXXXXXXXXXXX"
$location = "Southeast Asia"
$clusterNodes = "4"
$clusterType="HBase"
$ClusterVersion="3.2.7.757"

# Get the Storage account key
#$storageAccountKey = Get-AzureRmStorageAccountKey -ResourceGroupName $resourceGroupName -Name $storageAccountName | %{ $_.Key1 }
echo "Authentication Done ..!!!"
echo "Cluster deletion in Progress"
# Delete the HDInsight cluster
Remove-AzureRmHDInsightCluster -ClusterName $clusterName
echo "Cluster deleted"

Create script HDInsight Cluster

Login-AzureRmAccount
Import-AzurePublishSettingsFile "F:\Microsoft Azure Sponsorship-12-16-2015-credentials (2).publishsettings"
Get-AzureRmSubscription  # list your subscriptions and get your subscription ID
$subscriptionName="Microsoft Azure Sponsorship"
#Select-AzureRmSubscription -SubscriptionId "<Your Azure Subscription ID>"
Select-AzureRmSubscription -SubscriptionName $subscriptionName

$resourceGroupName = "hdinsight_southeastasia"

$storageAccountName = "XXXXXXXXXXXXXX"
$containerName = "XXXXXXXXXXXXX"

$clusterName = "XXXXXXXXXXXXX"
$location = "Southeast Asia"
$clusterNodes = "4"
$clusterType="HBase"
$ClusterVersion="3.2.7.757"

# Get the Storage account key
$storageAccountKey = Get-AzureRmStorageAccountKey -ResourceGroupName $resourceGroupName -Name $storageAccountName | %{ $_.Key1 }
echo "Authentication Done ..!!!"
echo "Cluster creation in Progress"
# Create a new HDInsight cluster
New-AzureRmHDInsightCluster -ResourceGroupName $resourceGroupName `
    -ClusterName $clusterName `
    -Location $location `
    -DefaultStorageAccountName "$storageAccountName.blob.core.windows.net" `
    -DefaultStorageAccountKey $storageAccountKey `
    -DefaultStorageContainer $containerName  `
    -ClusterSizeInNodes $clusterNodes `
-ClusterType $clusterType `


echo "Cluster Created.."

Sunday 10 January 2016

Contract Between HashCode and equals() Method in Java

Contract between hashcode and equals():

If two objects are considered equal using equals() method Then they must have identical hashcode() .
So if you override equals() then override hashCode() as well.

Saturday 9 January 2016

How to transfer data from Hadoop cluster to Azure Blob

Add following properties into core-site.xml

<property>
        <name>fs.azure.account.key.<@container name>.blob.core.windows.net</name>
        <value><account key value></value>
   </property>

And make access of blob as container in Azure Portal

Now We can transfer data from hadoop cluster to azure blob container.

hadoop fs - localpath  azure_blob_path

For transfering Hdfs to azure blob :

hadoop distcp hdfs://hostname:8020/filename  azure_blob_path

Azure Blob path can be  :

wasb://<containername>@<storageAccountName>.blob.core.windows.net