Showing posts with label copy to hdfs. Show all posts
Showing posts with label copy to hdfs. Show all posts

Sunday, August 28, 2011

Copy To Hadoop In Scale - Part 2

I was very much in unrest to copy huge number of files in to HDFS for a long time.
Frantcially "Googled", and asked questions on diffrent forum's. Some questions was foolish. How do I know that ?
Forum folks answered or sometimes even they did not. But I tried as I am really inspired by the quote
"STAY HUNGRY STAY FOOLISH". Finally found some way we can use the hadoop data node monsters to help me copy the files.
Hadoop is like a monster CPU - monster Hard Drive. Then Found DISTCP - a unique tool which is very useful for hadoop developers.
And came

https://github.com/Jagaran/HadoopCopier

This tool uses Cloudera Hadoop CDH3 as in libraries.

There are many interesting findings in "My Lab" to follow on in the endeavor of being "HUNGRY and FOOLISH"
Sometimes you have people,utilities and things near to you who can do the job for you and you search distant places.
In my native West Bengal, India there is a very famous quote "Rural sage doesn't get the credit".
I found utilites in my laptop present for last 6 months to do my job which I searched across the web.
For you it can be different - think once - Are you missing something ??

Stay tuned

JD

Tuesday, August 16, 2011

Copy To Hadoop In Scale

Data Copying in large volume has been very high latency job in HDFS. Recently we moved in to HDFS based aggregation from our legacy perl based aggregation. We already have a inbuilt infrastructure where data is being dumped into a network file system and then use perl aggregation jobs to crunch the data. As we moved into hadoop, we are facing difficulties in copying such volume of data to HDFS.As said in my previous post we were trying options to bring data into hadoop. I tried few options.
I have written a small piece of code that takes a list of files to copy in File URI format and process the copy in a multithreaded way using the FileSystem API methods of CHD3. The other option was to use the map reduce tools and use a Map Reduce jobs to copy your files into HDFS. We can use the raw processing power of your cluster in copying but IO time is of concern.
Would share the code in https://github.com/ shortly.
There are proper tools like Flume and Scribe to bring BigData in to hadoop.
Would come back with small code pieces to work with Flume and Scribe shortly.

Saturday, August 13, 2011

Struggling to Copy to HDFS

Actually we are really struggling to copy data from HDFS. We are using hadoop to aggregate data and make reports for executives.
We have a SLA of 15 minutes.
Currently we do a copy from local periodically using a shell script and data volume is around 120 GB/day and it works.
File sizes are small and so we run a pig script after copying to make file size optimum.

But Recently due to some major product releases coming shortly , the projected data would increase to 12 TB/day. (Sales Prjection).
Our current solution would not scale to maintain the SLA.
So thought of few options to optimize the copy to hadoop:

1. Currently we copy from a mounted filer - There is a separate application that does the copy to filer. I thought of streaming directly to hdfs using FileSystem Class and opening multiple connections and writing through it continuously. There could be a peak period in a day where we may have to write 1GB/sec. Would this solution scale??
2. Going by our current approach, we would copy from the filer but to speed up things
a. We have to do a copy in a multithreaded way - Basically running copyFromLocal by multiple threads
b. Saw a blog where people have a single node cluster, then did a distcp to the original big cluster. They said, discp works in parallel
c. A Map-Reduce Code to do copy from local filesystem to hdfs.I need to have a custom FileInputFormat Class