DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Hadoop on AmpereOne Reference Architecture
  • From 13,000 to 20,000+ Endpoints: Architecting Forensics for the Remote Workforce
  • Should You Use Azure Data Factory?
  • Automate Azure Databricks Unity Catalog Permissions at the Schema Level

Trending

  • The Invisible OOMKill: Why Your Java Pod Keeps Restarting in Kubernetes
  • Monitoring Spring Boot Applications with Prometheus and Grafana
  • The Hidden Bottlenecks That Break Microservices in Production
  • Context-Aware Authorization for AI Agents
  1. DZone
  2. Coding
  3. Tools
  4. Migrate HDFS Data to Azure

Migrate HDFS Data to Azure

A developer and Hadoop expert runs through the processes he and his team used to transfer their data over network with TLS encryption when switching to Azure.

By 
Radhika Mekala user avatar
Radhika Mekala
·
Apr. 23, 21 · Analysis
Likes (3)
Comment
Save
Tweet
Share
8.3K Views

Join the DZone community and get the full member experience.

Join For Free

During the middle of last year, my team decided to move our Hadoop workloads to Azure, including our data and applications. This article provides some of the best practices we used in migrating on-premises HDFS data to Azure HDInsight. Mentioned below are two approaches that we adopted to transfer the data over network with TLS encryption.

Method 1

The ExpressRoute Azure service uses a private connection between Azure and on-premise data centers (ExpressRoute offers higher security, reliability, and speeds with lower latencies than typical connections over the Internet). We took advantage of Data Factory's native data copy functionality using the integration runtime to migrate the data. Data Factory's self-hosted integration runtime (SHIR) should be installed on a pool of Windows VMs on an Azure virtual network. The VMs can be scaled out to multiple VMs to fully utilize network and storage IOPS or bandwidth.


This approach is recommended when there is a need to migrate huge amounts of data (i.e. data volume > 50 GB) for legacy applications.

Method 2

Transfer your data to Azure storage over a regular internet connection using any one of several tools, such as: AzCopy, Azure PowerShell, and Azure CLI.

This approach is used to copy smaller volumes of data (i.e. 2-5 GB or less), or, for ad-hoc purposes, PoC environment data, or to transfer data to Azure that does not involve any transformations.

Example 1: 

Shell
 




x


 
1
azcopy copy  '<local-directory-path>' 'https://<storage-account-name>.file.core.windows.net/<file-share-name>' --recursive


The above azcopy command copies an entire directory (recursively) using azcopy and all the underlying files in that directory to an Azure container. The result is a directory in the Azure container by the same name.

Example 2:

Shell
 




xxxxxxxxxx
1


 
1
az storage fs file upload -s "C:\myFolder\upld.txt " -p    testdir/upld.txt  -f testcont --account-name teststorgeaccount  --auth-mode login


The above az cli command uploads a file named upld.txt from the local file system to a directory testdir in an Azure container named testcon under the storage account teststorgeaccount.

Example 3:

PowerShell
 




xxxxxxxxxx
1
11


 
1
$contxt = New-AzStorageContext -StorageAccountName '<storage-account-name>' -StorageAccountKey '<storage-account-key>'
2

          
3
$localSrcFile =  "upld.txt"
4

          
5
$containerName = "testcont"
6

          
7
$dirname = "testdir/"
8

          
9
$destPath = $dirname + (Get-Item $localSrcFile).Name
10

          
11
New-AzDataLakeGen2Item -Context $contxt -FileSystem $containerName -Path $destPath -Source $localSrcFile -Force


The above set of PowerShell commands uploads a file named upld.txt from the local file system to a   directory called testdir in the Azure container named testconr.

Data (computing) azure hadoop File system

Opinions expressed by DZone contributors are their own.

Related

  • Hadoop on AmpereOne Reference Architecture
  • From 13,000 to 20,000+ Endpoints: Architecting Forensics for the Remote Workforce
  • Should You Use Azure Data Factory?
  • Automate Azure Databricks Unity Catalog Permissions at the Schema Level

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook