Presentation on theme: "Transitioning of existing applications to use HDFS August 2008."— Presentation transcript:
Transitioning of existing applications to use HDFS August 2008
2 ContextWeb: Traffic Traffic – up to 10 thousand Ad requests per second. Comscore Trend Data:
3 ContextWeb Architecture highlights Pre – Hadoop aggregation framework Logs are generated on each server and aggregated in memory to 15 minute chunks Aggregation of logs from different servers into one log Load to DB Multi-stage aggregation in DB About 20 different jobs end-to-end Could take 2hr to process through all stages
Hadoop Data Set Up to 160GB of raw log files per day. 10TB for 60 days 30 different aggregated data sets 25TB total to cover 1 year (uncompressed) For example, list of URLs with Keywords for every impression – 15TB total (uncompressed). Multiply by 3 replicas … Compression would help – potential compression ratio 1:15 – 1:20
5 Architectural Challenges How to organize data set to keep aggregated data sets fresh. Logs constantly appended to the main DataSet. Reports and aggregated datasets should be refreshed every 15 minutes Mix of.NET and Java applications. (80%+.Net, 20%- Java) How to make.Net application write logs to Hadoop? Some 3 rd party applications to consume results of MapReduce Jobs (e.g. reporting application) How make 3 rd party or internal Legacy applications to read data from Hadoop ?
6 Partitioned Data Set: approach Date/Time as dimension for Partitioning Segregate results of MapReduce jobs into Daily Files/Directories Each Daily file is regenerated if input into MR job contains data for this Day Use revision number for each file. This way multi-stage jobs could overlap during processing (HDFS is still write-once, at least for now)
7 Partitioned Data Set: processing flow
8 Partitioned Data Set: Implementation Use MultipleOutputFormat to generate daily files/directories Provide your own generateFileNameForKeyValue() Compression is supported out of the box Use PartitionerClass to make sure that all rows for the same day go to the same reducer Provide your own getPartition() int partitionID = dateHash % numPartitions;
9 Getting Data in and out Mix of.NET and Java applications. (80%+.Net, 20%- Java) How to make.Net application write logs to Hadoop? Some 3 rd party applications to consume results of MapReduce Jobs (e.g. reporting application) How make 3 rd party or internal Legacy applications to read data from Hadoop ?
10 Getting Data in and out: distcp Hadoop Distcp - hdfs - /mnt/abc – network share Easy to start – just allocate storage on network share But… Difficult to maintain if there are more than 10 types of data to copy Need extra storage. Outside of HDFS. (oxymoron!) Extra step in processing Clean up
11 Getting Data in and out: WebDAV driver WebDAV server is part of Hadoop source code tree Needed some minor clean up WebDAV client is pre-installed on Windows Linux Mount Modules available from mnt]# cd /mnt mnt]# mkdir -p hadoop/prod mnt]# mount -t davfs hadoop/prod/ ~]# mount | grep hadoop on /mnt/hadoop/prod type davfs (rw,nosuid,nodev,_netdev) ~]# cd /mnt/hadoop/prod/ prod]# ls geo geo1.txt hadoop home lost+found old_versions rpt system testing tmp user wide
12 Getting Data in and out: Running Server on Linux
13 Getting Data in and out: Running Server on the same node where client is installed
WebDAV and compression But your results are compressed… Options: Decompress files on HDFS – an extra step again Refactor your application to read compressed files… Java – Ok.Net – much more difficult. Cannot decompress SequenceFiles 3 rd party- not possible
WebDAV and compression Solution – extend WebDAV to support compressed SequenceFiles Same driver can provide compressed and uncompressed files If file with requested name foo.bar exists – return as is foo.bar If file with requested name foo.bar does not exist – check if there is a compressed version foo.bar.seq. Uncompress on the fly and return as if foo.bar Outstanding issues Temporary files are created on Windows client side There are no native Hadoop (de)compression codecs on Windows