hadoop distributed file system usage in uscms michael thomas, dorian kcira california institute of...

34
Hadoop Hadoop Distributed File Distributed File System Usage in System Usage in USCMS USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009

Post on 23-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

Hadoop Distributed Hadoop Distributed File System Usage in File System Usage in

USCMSUSCMSMichael Thomas, Dorian Kcira

California Institute of Technology

SuperComputing 2009

November 14-20 2009, Portland, OR

Page 2: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

2

What is HadoopWhat is Hadoop

• Map-Reduce plus the HDFS filesystem implemented in Java

• Map-Reduce is a highly parallelized distributed computing system

• HDFS is the distributed cluster filesystemo This is the feature that we are most interested in

• Open source project hosted by Apache• Commercial support available from Cloudera• Used throughout Yahoo. Cloudera and Yahoo

are major contributors to the Apache Hadoop project.

Page 3: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

3

HDFSHDFS

• Distributed Cluster filesystem• Extremely scalable – Yahoo uses it for multi-PB

storage• Easy to manage – few services and little

hardware overhead• Files split into blocks and spread across

multiple cluster datanodeso 64MB blocks default, configurableo Block-level decomposition avoids 'hot-file' access bottleneckso Block-level decomposition means loss of multiple data nodes

will result in the loss of more files than file-level decomposition

• Not 100% Posix complianto Non-sequential writes not supportedo Not a replacement for NFS

Page 4: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

4

HDFS ServicesHDFS Services

• Namenode – manages the filesystem namespace operationso File/directory creation/deletiono Block allocation/removalo Block locations

• Datanode – stores file blocks on one or more disk partitions

• Secondary Namenode – helper service for merging namespace changes

• Services communicate through java RPC, with some functionality exposed through http interfaces

Page 5: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

5

Namenode (NN)Namenode (NN)

• Purpose is similar to dCache PNFS• Keeps track of entire fs image

o The entire filesystem directory structureo The file block datanode mappingo Block replication levelo ~1GB per 1e6 blocks recommended

• Entire namespace is stored in memory, but persisted to disko Block locations not persisted to disko All namespace requests served from memoryo fsck across entire namespace is really fast

Page 6: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

6

Namenode JournalsNamenode Journals

• NN fs image is read from disk only once at startup

• Any changes to the namespace (mkdir, rm) are written to one or more journal files (local disk, NFS, ...)

• Journal is periodically merged with the fs image

• Merging can temporarily require extra memory to store two copies of fs image at once

Page 7: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

7

Secondary NNSecondary NN

• The name is misleading... this is NOT a backup namenode or hot spare namenode. It does NOT respond to namespace requests

• Optional checkpoint server for offloading the NN journal fsimage merges

• Download fs image from namenode (once)• Periodically download journal from namenode• Merge journal and fs image• Uploaded merged fs image back to namenode• Contents of merged fsimage can be manually

copied to NN in case of namenode corruption or failure

Page 8: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

8

Datanode (DN)Datanode (DN)

• Purpose is similar to dCache pool• Stores file block metadata and file block contents

in one or more local disk partitions. Datanode scales well with # local partitionso Caltech is using one per local disko Nebraska has 48 individual partitions on Sun

Thumpers

• Sends heartbeat to namenode every 3 seconds• Sends full block report to namenode every hour• Namenode uses report + heartbeats to keep track

of which block replicas are still accessible

Page 9: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

9

Client File AccessClient File Access

• When a client requests a file, it first contacts the namenode for namespace information.

• The namenode looks up the block locations for the requested files, and returns the datanodes that contain the requested blocks

• The client contacts the datanodes directly to retrieve the file contents from the blocks on the datanodes

Page 10: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

10

Hadoop ArchitectureHadoop Architecture

Page 11: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

11

Native ClientNative Client

• A native java client can be used to perform all file and management operations

• All operations use native Hadoop java APIs

Page 12: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

12

File System in User Space (FUSE)File System in User Space (FUSE)

• Client that presents a posix-like interface to arbitrary backend storage systems (ntfs, lustre, ssh)

• HDFS fuse module provides posix interface to HDFS using the HDFS APIs. Allows standard filesystem commands on HDFS (rm, cp, mkdir,...)

• HDFS does not support non-sequential (random) writeso root TFile can't write directly to HDFS fuse, but not

really necessary for CMSo but files can be read through fuse with CMSSW / TFile -

eventually CMSSW can use the Hadoop API

• Random reads are ok

Page 13: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

13

Gridftp/SRM ClientsGridftp/SRM Clients

• Gridftp could write to HDFS+FUSE with a single stream

• Multiple streams will fail due to non-sequential writes

• UNL (Nebraska) developed a GridFTP dsi module to buffer multiple streams so that data can be written to HDFS sequentially

• Bestman SRM can perform namespace operations by using FUSEo running in gateway modeo srmrm, srmls, srmmkdiro Treats HDFS as local posix filesystem

Page 14: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

US Atlas T2/T3 Workshop Nov. 12 2009Michael Thomas 14

Hadoop monitoringHadoop monitoringNagiosNagios

•check_hadoop_health – parses output of 'hadoop fsck'check_hadoop_health – parses output of 'hadoop fsck'

•check_jmx – blockverify failures, datanode spacecheck_jmx – blockverify failures, datanode space

•check_hadoop_checkpoint – parses secondary nn logs to make sure check_hadoop_checkpoint – parses secondary nn logs to make sure checkpoints are occurringcheckpoints are occurring

GangliaGanglia•Native integration with HadoopNative integration with Hadoop

•Many internal parametersMany internal parameters

MonALISAMonALISA•Collects Ganglia parametersCollects Ganglia parameters

gridftpspygridftpspy

Hadoop ChronicleHadoop Chronicle

jconsolejconsole

hadoop native web pageshadoop native web pages

Page 15: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

US Atlas T2/T3 Workshop Nov. 12 2009Michael Thomas 15

Page 16: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

US Atlas T2/T3 Workshop Nov. 12 2009Michael Thomas 16

hadoop httphadoop http

Page 17: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

US Atlas T2/T3 Workshop Nov. 12 2009Michael Thomas 17

gridftpspygridftpspy

Page 18: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

18

Caltech SetupCaltech Setup

• Current Tier2 cluster runs RHEL4 with dCache. We did not want to disturb this working setup

• Recently acquired 64 additional nodes, installed with Rocks5/RHEL5. This is set up as a separate cluster with its own CE and SE. Avoids interfering with working RHEL4 cluster

• Single PhEDEx instance runs on the RHEL4 cluster, but each SE has its own SRM server

• Clusters share the same private subnet

Page 19: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

US Atlas T2/T3 Workshop Nov. 12 2009Michael Thomas 19

Caltech SetupCaltech Setup

Page 20: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

20

Caltech SetupCaltech Setup• Namenode runs on same system as Condor

negotiator/collectoro 8 cores, 16GB RAMo System is very over-provisioned. Load never exceeds 1.0, JVM

uses ~1GB out of 2GBo Plenty of room for scaling to more blocks

• Secondary NN on a mostly dedicated servero Used to OOM when run on a worker node

• 140 data nodes, 560TB available spaceo Includes 2 Sun Thumpers running Solariso Currently only 470TB usedo All datanodes are also condor batch workers

• Single Bestman SRM server using FUSE for file ops• Two gridftp-hdfs servers

o 4 with 2 x 10GBE, 8 with 2 x 1 GbE

Page 21: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

21

Deployment HistoryDeployment History

T2_US_Nebraska first started investigating Hadoop last year (2008). They performed a lot of R&D to get Hadoop to work in the CMS context

• Two SEs in SAM• Gridftp-hdfs DSI module• Use of Bestman SRM• Many internal Hadoop bug fixes and

improvements• Presented this work to the USCMS T2

community in February 2009

Page 22: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

22

Tier2 Hadoop WorkshopTier2 Hadoop Workshop

• Held at UCSD in early March 2009• Intended to help get interested USCMS Tier2 sites

jump-start their hadoop installations• Results:

o Caltech, UCSD expanded their hadoop installationso Wisconsin delayed deployment due to facility problemso Bestman, GridFTP servers deployedo Initial SRM stress tests performedo UCSD Caltech load tests startedo Hadoop SEs added to SAMo Improved RPM packagingo Better online documentation for CMS

• https://twiki.grid.iu.edu/bin/view/Storage/HdfsWorkshop

Page 23: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

23

Caltech DeploymentCaltech Deployment

• Started using Hadoop in Feb. 2009 on a 4-node testbed

• Created RPMs to greatly simplify the deployment across an entire cluster

• Deployed Hadoop on new RHEL5 cluster of 64 nodes

• Basic functionality worked out of the box, but performance was poor.

• Attended a USCMS Tier2 hadoop workshop at UCSD in early March

Page 24: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

24

Caltech DeploymentCaltech Deployment

• Migrated OSG RSV tests to Hadoop in mid-march

• Migrated data from previous SE over the course of 6 months (Apri. – Oct.). Operated two SEs during this time.

• Added read-only http interface in mid-May• CMS review on Hadoop on Sep. 16. Formal

approval given on Oct 21• Decomissioned dCache on Oct 22, using

Hadoop as unique SE at Caltech

Page 25: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

25

Current SuccessesCurrent Successes• SAM tests passing• All PhEDEx load tests passing• RPMs provide easy installs, reinstalls

o hadoop, gridftp, bestman, xrootd (under development)

• Bestman + GridFTP-HDFS have been stable• Great inter-node transfer rates (4GB/s

aggregate)• Adequate WAN transfer rates (7Gbps peaks)• Extensive install/config documentation

o https://twiki.grid.iu.edu/bin/view/Storage/Hadoop

• Primary storage system at 3 USCMS T2 sites: Caltech, Nebraska, San Diego

Page 26: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

Why Hadoop ?Why Hadoop ?

• CaltechCaltech: “Lower operational overhead : “Lower operational overhead due to fewer moving part. The simple due to fewer moving part. The simple architecture is relatively easy to architecture is relatively easy to understandunderstand

• UCSDUCSD: “Scalable SRM and replication : “Scalable SRM and replication that just works and FUSE interface is that just works and FUSE interface is simple for admins and users to work simple for admins and users to work with”with”

• UNLUNL: “Manageability and reliability”: “Manageability and reliability”

Page 27: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

27

Not without problems...Not without problems...

• OSG RSV tests required patch to remove “:” from filenames. This is not a valid character in hadoop filenames. (resolved in OSG 1.2)

• Bestman dropped VOMS FQAN for non-delegated proxies, caused improper user mappings and filesystem permission failures for SAM, PhEDEx (resolved)

• TFC not so “t” anymore*

• Datanode/Namenode version mismatches (improved)

• Initial performance was poor (400MB/s aggregate) due to cluster switch configuration (resolved)

*) TFC = Trivial File Catalog

Page 28: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

28

Not without more problems...Not without more problems...• FUSE was not so stable

o Boundary condition error for files with a specific size crashed fuse (resolved)

o df sometimes not showing fuse mount space (resolved)o Lazy java garbage collection resulted in hitting ulimit for

open files (resolved with larger ulimit)o scp, tar, rsync didn’t work (resoved)

• Running two CEs and SEs requires extra care so that both CEs can access both SEso Some private network configuration issues (resolved)o Lots of TFC wrangling

• Running two CEs and SEs requires extra care so that both CEs can access both SEso Some private network configuration issues (resolved)o Lots of TFC wrangling

Page 29: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

29

Many Read ProcessesMany Read Processes

Looping reads on 62 machines, one read per machine

Page 30: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

30

Many Parallel Writes with FUSEMany Parallel Writes with FUSE

Write 4GB file on 62 machines (dd+fuse) with 2x replication

(1.8GB/s)

Page 31: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

31

Replicate by DecommisionReplicate by DecommisionDecommission 10 machines at once, resulting in the namenode

issuing many replication tasks (1.7GB/s)

Page 32: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

32

UCSD UCSD Caltech Load Tests Caltech Load Tests

2 x 10GbE GridFTP servers, 260MB/s

Page 33: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

33

Next StepsNext Steps

• Make another attempt to move /store/user to HDFS

• More benchmarks to show that HDFS satisfies the CMS SE technology requirements

• Finish validation that both CEs can access data from both SEs

• More WAN transfer tests and tuningo FDT + HDFS integration starting soon

• Migrate additional data to Hadoopo All of /store/usero /store/unmergedo Non-CMS storage areas

Page 34: Hadoop Distributed File System Usage in USCMS Michael Thomas, Dorian Kcira California Institute of Technology SuperComputing 2009 November 14-20 2009,

34

Overall ImpressionsOverall Impressions

• Management of HDFS is simple relative to other SE options

• Performance has been more than adequate• Scaled from 4 nodes to 64 nodes with no

problems• ~50% of our initial problems were related to

Hadoop, the other 50% were Bestman, TFC, PhEDEx agent, or caused by running multiple SEs

• We currently plan to continue using Hadoop and expand it moving forward