Lecture 5 - Big Data Framework
DES431 - Big Data Analytics and Machine Learning
Lecture 5: Big Data Framework
Asst.Prof.Dr. Apichon Witayangkurn (apichon@siit.tu.ac.th)
[Image]
Roadmap
- Hadoop Ecosystem
- HDFS (Distributed File System)
- Data Flow
- Common Command
- Hadoop File Formats
- YARN (Yet Another Resource Negotiator)
- Hadoop Execution
- Hadoop Distribution
- Setup Hadoop Cluster
- CPU, Memory
- Storage, Network
- OS
- Data Lake
Hadoop in Definition
Related
What is Hadoop?
- Hadoop is an open-source framework for writing and running distributed applications that process large amounts of data
- Distributed computing is a wide and varied field, but the key distinctions of Hadoop are:
- Accessible — Hadoop runs on large clusters of commodity machines or on cloud computing services such as Amazon's Elastic Compute Cloud (EC2)
- Robust — Because it is intended to run on commodity hardware, Hadoop is architected with the assumption of frequent hardware malfunctions. It can gracefully handle most such failures
- Scalable — Hadoop scales linearly to handle larger data by adding more nodes to the cluster
- Simple — Hadoop allows users to quickly write efficient parallel code
Think of Hadoop like a warehouse crew made of many ordinary workers (cheap PCs) instead of one superhuman worker (an expensive supercomputer). If one worker gets sick (hardware fails), the rest keep going. Need more work done? Just hire more ordinary workers (add nodes).
[Image] — Hadoop logo
Hadoop Main Components
- NameNode + JobTracker (Master)
- Keeps metadata & distributes jobs
- Secondary NameNode
- Works alongside NameNode
- DataNode + TaskTracker (Workers, 1 per PC)
- Robust: Replicates data among data nodes
- Add more nodes to scale out
The NameNode is like a librarian who doesn't hold any books herself, but knows exactly which shelf (DataNode) every book (data block) sits on, and can tell workers where to go get it.
[Image] — Hadoop Main Components diagram (NameNode/JobTracker, Secondary NameNode, DataNodes/TaskTrackers)
(Source: Lam., 2011)
Hadoop Ecosystem
[Image] — Hadoop Ecosystem diagram (MapReduce, Hive & Drill, Mahout & Spark MLlib, Pig, HBase, Zookeeper & Ambari, Spark, Kafka & Storm, Solr & Lucene, Oozie, YARN, HDFS, Flume, Sqoop)
Projects under the Hadoop Umbrella (Part 1)
- Common — A set of components and interfaces for distributed file systems and general I/O (serialization, Java RPC, persistent data structures)
- HDFS — A distributed filesystem that runs on large clusters of commodity machines
- YARN — A framework for job scheduling and cluster resource management
- MapReduce — A distributed data processing model and execution environment that runs on large clusters of commodity machines
- Hive — A distributed data warehouse. Manages data stored in HDFS and provides a SQL-based query language (translated by the runtime engine into MapReduce jobs)
- Spark — Fast and general compute engine for Hadoop data. Provides a simple and expressive programming model supporting a wide range of applications, including ETL, machine learning, stream processing, and graph computation
- Sqoop — A tool for efficiently moving data between relational databases and HDFS
Projects under the Hadoop Umbrella (Part 2)
- HBase — A distributed, column-oriented database. Uses HDFS for underlying storage and supports both batch-style computations (MapReduce) and point queries (random reads)
- ZooKeeper — A distributed, highly available coordination service. Provides primitives such as distributed locks for building distributed applications
- Pig — A data flow language and execution environment for exploring very large datasets. Runs on HDFS and MapReduce clusters
- Ambari — A web-based tool for provisioning, managing, and monitoring Apache Hadoop clusters, including a dashboard for viewing cluster health visually
- Mahout — A scalable machine learning and data mining library
- Tez — A generalized data-flow programming framework built on Hadoop YARN, which provides a powerful and flexible engine to execute an arbitrary DAG of tasks for both batch and interactive use-cases
Think of the Hadoop ecosystem like a city: HDFS is the land/storage, YARN is the traffic control system allocating resources, and all the other tools (Hive, Pig, HBase, Spark...) are different types of buildings/businesses that use that land and traffic system for their own purposes.
Hadoop 1.0 vs 2.0
[Image] — Architecture Comparison diagram (Hadoop 1.0: Single Use System/Monolithic vs Hadoop 2.0: Multi Use Data Platform/Layered)
- Hadoop 1.0 — Single Use System (Batch Apps), Monolithic:
- Resource Management
- Execution Engine
- User API
- Hadoop 2.0 — Multi Use Data Platform (Batch, Interactive, Online, Streaming...), Layered:
- Resource Management — YARN
- Execution Engine — Tez
- User API — Hive, Pig, Cascading, Your App!
[Image] — MR v1 vs YARN/MR v2 architecture diagram (Client, JobTracker/NameNode, TaskTracker/DataNode vs Client, ResourceManager/NameNode, NodeManager/ApplicationMaster/Container/DataNode)
- YARN: Yet Another Resource Negotiator
- MR: MapReduce
Hadoop 1.0 is like a restaurant where the head chef (JobTracker) both manages the kitchen resources AND decides how each dish is cooked. Hadoop 2.0 splits this: the head chef (ResourceManager) just manages resources (stoves, staff), while separate sous-chefs (ApplicationMaster) handle how each specific dish is prepared — letting the kitchen run many different types of cuisine (batch, streaming, interactive) at once.
Hadoop Distributed File System (HDFS): Key Idea
- Hide system-level details from the developers
- No more race conditions, lock contention, etc.
- Don't move data to workers... move workers to the data!
- Store data on the local disks of nodes in the cluster
- Start up the workers on the node that has the data local
- Why?
- Not enough RAM to hold all the data in memory
- Disk access is slow, but disk throughput is reasonable
- Fast recovery from hardware failures
- A distributed file system is the answer
- HDFS (Hadoop Distributed File System) for Hadoop
It's cheaper to send the recipe (the computation) to where the ingredients (data) already are, than to ship truckloads of ingredients across town to one central kitchen.
[Image] — Hadoop HDFS logo
Key Features of HDFS
- Commodity hardware
- Scale Out, not up
- Distributed file system
- Handles large sets of data that run on commodity hardware
- Scale a Hadoop cluster to hundreds/thousands of nodes
- Blocks
- Splits large files into small pieces known as Blocks
- By default, block size is
- Hadoop distributes blocks across multiple nodes
- Replication
- Data blocks are replicated to provide fault tolerance; number of replicas of a file can be specified
- The replication factor can be specified at file creation time and can be changed later
- The NameNode receives a Heartbeat and a Block report from each of the DataNodes in the cluster
- Simple Library and CLI
"Scale out, not up" means instead of buying one giant, ultra-expensive server (scaling up), you buy many cheap ordinary servers and use them together (scaling out) — like adding more delivery trucks instead of buying one giant truck.
[Image] — Hadoop HDFS logo
Commodity Hardware
Related
- Computers or components that are readily available
- Inexpensive and easily interchangeable with other commodity hardware
- Almost all PCs use commodity hardware
- Easily replaceable
[Image] — Photos of commodity server hardware components (Photo Credit: Stephen Shankland/CNET)
Hadoop Distributed File System (HDFS)
Related
- Distributed file system designed to run on commodity hardware
- It is used to scale a single Apache Hadoop cluster to hundreds of nodes
[Image] — HDFS architecture diagram (Client, NameNode, DataNodes across racks, Metadata ops, Block ops, Replication, Read/Write flows)
Data in HDFS (Example)
- 1GB file, Block: 64MB, Replication: 2
- Distribution example:
- D1: B1, B3
- D2: B1
- D3: B2
- D4: B2, B3
Imagine cutting a 1GB cake into slices (blocks) of 64MB each, then giving copies of each slice to two different friends (replication factor 2) so that if one friend eats their slice (node fails), you still have a backup copy elsewhere.
HDFS – Rack and Rack Awareness
- Replication Factor of 3: Hadoop is smart enough to place the replicas of Blocks in Racks so as to optimize replica placement and maximize the reading speed
[Image] — Rack awareness diagram showing Block A, B, C replicated across DataNodes in Rack A, Rack B, Rack C connected via Switch
Rack Awareness Policy
- Processes on the same node
- Different nodes on the same rack
- Nodes on different racks in the same data center
- Nodes in different data centers
Distance Examples
For a node n1 on rack r1 in data center d1, represented as /d1/r1/n1:
- (processes on the same node)
- (different nodes on the same rack)
- (nodes on different racks in the same data center)
- (nodes in different data centers)
[Image] — Distance diagram between nodes n1, n2, n3, n4 across racks r1, r2, r3 and data centers d1, d2
Rack awareness is like choosing where to store backup copies of an important document: keep one copy on your desk (same node = fastest access, distance 0), one copy in a filing cabinet across the office (same rack, distance 2), one in another building (different rack/data center, distance 4-6). Closer copies are faster to grab but a disaster in one place won't wipe out ALL your copies since they're spread out.
Data Flow
HDFS — A client writing data to HDFS
- Steps: 1. create → 2. create (NameNode) → 3. write → 4. write packet → 5. ack packet → 6. close → 7. complete
- Replication = 3, using a pipeline of DataNodes
[Image] — Data flow diagram for HDFS client write (HDFS client, Distributed FileSystem, FSDataOutputStream, NameNode, Pipeline of DataNodes)
(Source: O'Reilly, 2011)
HDFS — A client reading data from HDFS
- Steps: 1. open → 2. get block locations (NameNode) → 3. read → 4/5. read (from DataNodes, optimized for Disk I/O) → 6. close
[Image] — Data flow diagram for HDFS client read (HDFS client, Distributed FileSystem, FSDataInputStream, NameNode, DataNodes)
(Source: O'Reilly, 2011)
Writing to HDFS is like mailing copies of a letter through a relay of post offices (DataNodes) that each pass it along and confirm receipt (ack) back up the chain. Reading is like asking a directory (NameNode) where the nearest copy is, then going straight to grab it — optimized so you don't waste time going to a far-away copy.
HDFS – Web Management
- Runs on port 50070
- Check Status
- Safemode off
- Shows: files/directories/blocks counts, heap memory, configured capacity, DFS used/remaining, block pool used, DataNode usage %, live/dead/decommissioning nodes, under-replicated blocks, etc.
[Image] — HDFS Web UI Overview screenshot (Hadoop NameNode web management dashboard)
- See DataNodes status
- Make sure all running
- Disk Remaining
[Image] — HDFS Web UI Datanode Information screenshot (table of nodes, HTTP address, capacity, blocks, version)
- Browse Directory (e.g.
/apps/hive/warehouse/apichon.db)
[Image] — HDFS Web UI Browse Directory screenshot (permissions, owner, group, size, replication, block size, name)
- File Data (block information: Block ID, Block Pool ID, Generation Stamp, Size, Availability across nodes)
[Image] — HDFS Web UI File information screenshot (block details and availability)
HDFS – Common CLI
| Command | Description |
|---|---|
hdfs dfs -ls / | Print all the directories present in HDFS |
hdfs dfs -mkdir <folder> | To create a directory |
hdfs dfs -cat <path> | To print file contents |
hdfs dfs -copyFromLocal <local file> <dest (on hdfs)> | To copy files/folders from local file system to hdfs store |
hdfs dfs -copyToLocal <dest (on hdfs)> <local file> | To copy files/folders from hdfs store to local file system |
hdfs dfs -moveFromLocal <local file> <dest (on hdfs)> | To move files/folders from local file system to hdfs store |
hdfs dfs -cp <src(on hdfs)> <dest(on hdfs)> | To copy files within hdfs |
hdfs dfs -rmr <filename/directoryName> | To delete a file from HDFS recursively |
hdfs dfs -du <dirName> | It will give the size of each file in directory |
hdfs dfs -setrep 4 <filename> | Change the replication factor of a file/directory in HDFS |
hdfs dfs -chmod 775 <filename> | Change the permissions of a file |
HDFS – Check Filesystem CLI
- Command:
hdfs fsck / - To check the file system and make sure it's healthy
Status: HEALTHY
Total size: 4567888097690 B (Total open files size: 35797876 B)
Total dirs: 1214002
Total files: 805933
Total symlinks: 0 (Files currently being written: 13)
Total blocks (validated): 828673 (avg. block size 5512292 B)
Minimally replicated blocks: 828673 (99.99999 %)
Over-replicated blocks: 0 (0.0 %)
Under-replicated blocks: 0 (0.0 %)
Mis-replicated blocks: 0 (0.0 %)
Default replication factor: 2
Average block replication: 2.0010958
Corrupt blocks: 0
Missing replicas: 0 (0.0 %)
Number of data-nodes: 4
Number of racks: 1
FSCK ended at Sun Sep 10 12:21:43 ICT 2023 in 23065 milliseconds
The filesystem under path '/' is HEALTHY
HDFS – Balance HDFS Data
- When you add a new node to the cluster, all new blocks could be allocated to that node. Or some node/disk could fail
- Default threshold of 10 percent: Balance data by moving blocks from over-utilized to under-utilized nodes, until each DataNode's disk usage differs by no more than plus or minus 10 percent of the average disk usage in the cluster
- Commands:
hdfs balancer –threshold 5hdfs dfsadmin -setBalancerBandwidth
[Image] — Balance diagram showing Rack 1 & 2 (has data) redistributing blocks to Rack 3 (new, no data)
Balancing HDFS data is like a team of movers redistributing boxes evenly across storage units after a new, empty unit is added — so no single unit is overstuffed while another sits nearly empty.
Hadoop File Formats — When and What to Use?
- A storage format defines how information is stored in a file or database. Different data/file formats are used by different Big Data stack tools including Spark, Hadoop, Hive and others
- Text Data — Comes in the form of CSV or unstructured data such as tweets. CSV files are commonly used for exchanging data between Hadoop and external systems
- Structured Text Data — A more specialized form of text files such as XML or JSON. JSON processing is more challenging than XML because there are no tokens to mark the beginning or end of a record in JSON
- Sequence Files — Store data in a binary format with a similar structure to CSV. Sequence files store only data, and support block compression
- Columnar Data Format — (see next section)
Columnar Data Format
- Useful for recent modern Big Data applications
- When you need to access only a small subset of columns, use a columnar format database
- When you need to obtain many columns, a row-oriented database is preferable
[Image] — Diagram comparing Row Oriented Database vs Table of Data vs Column Oriented Database (date, price, size columns)
Think of a row-oriented database like a filing cabinet of full customer forms — great if you want to pull one customer's entire form. A columnar database is like separate stacks organized by just "all dates," "all prices," "all sizes" — great if you only need to scan one specific field across everyone, like calculating average price.
Columnar File Types
- RC (Record Columnar) Files — Developed to provide efficient processing for MapReduce applications
- Fast data loading, quick query processing, and highly efficient storage space utilization
- RC file is good for querying, but writing an RC file requires more memory and computation than non-columnar file formats
- ORC Files — Optimize performance in Hive. Similar to RC files
- ORC files compress better than RC files, enabling faster queries
- Cannot be used with non-Hive MapReduce interfaces such as Pig, Java, or Impala
- Parquet Files — Suitable for different interfaces such as Java, Hive, and Pig
- Also ideal for other processing engines such as Impala and Spark
- Performance as good as RC and ORC, but slower to write than other column formats
Why Adapting Hadoop Storage Format Matters
- Faster read/write times, splittable files
- Advanced compression support
File Size Comparison Across Encoding Methods (Dataset: TPC-DS Scale 500 Dataset)
- Text (Original Size): 585 GB
- RCFile: 505 GB (14% Smaller)
- Parquet (Impala): 221 GB (62% Smaller)
- ORCFile (Hive 12): 131 GB (78% Smaller)
- Notes: Larger block sizes; columnar format arranges columns adjacent within the file for compression & fast access
[Image] — Stripe/Index structure diagram showing 250 MB Stripes (Index Data, Row Data, Stripe Footer) mapping to Column 1-8 layout, plus File Footer/Postscript
Columnar formats like ORC/Parquet compress so well because similar data (e.g., all values in the "price" column) sit next to each other, and repeated/similar values compress much better together than when scattered among unrelated fields (like in a row-based text file).
Hadoop Execution (MapReduce V1)
- The client application submits an application request to the JobTracker
- The JobTracker determines how many processing resources are needed to execute the entire application
- The JobTracker checks the state of the slave nodes and queues all the map tasks and reduce tasks for execution
- As processing slots become available on the slave nodes, map tasks are deployed to the slave nodes. Map tasks are assigned to nodes where the same data is stored
- The JobTracker monitors task progress. If failure, the task is restarted on the next available slot
- After the map tasks are finished, reduce tasks process the interim result sets from the map tasks
- The result set is returned to the client application
[Image] — MapReduce V1 execution diagram (Client, JobTracker on Master Node with scheduling/progress tracking/fault tolerance/resource management, TaskTrackers with Map/Reduce Tasks on Slave Nodes)
Limitations of MapReduce V1
- Processing and Resource Management tie up together with MapReduce
- Exclusive tie to MapReduce means it could be used only for batch style workloads and general-purpose analysis
- Not good for:
- Real-time
- Ad-hoc analysis
- Stream Data
- Message Queue
[Image] — Diagram showing API layer (MapReduce, Pig, Hive, HBase) on top of Processing Framework/Resource Management (MapReduce v1) on top of Distributed Storage (HDFS)
MapReduce V1 is like a factory where the same manager (JobTracker) both assigns which machines get used AND controls exactly how the assembly line runs — meaning the factory can ONLY produce one type of product (batch jobs) and can't easily switch to handle rush/real-time orders.
YARN – Yet Another Resource Negotiator
- A resource management facility that can schedule and assign CPU cycles and memory from the Hadoop cluster, enabling other processing frameworks to run on Hadoop
- YARN has converted Hadoop from simply a batch processing engine to supporting interactive queries and streaming analysis
Key Components
- Resource Manager — manages resource allocation
- Application Master — manages resource needs for individual applications
- Node Manager — a generalized task tracker
- Container — executes an application-specific process
[Image] — YARN architecture diagram (Client, Resource Manager, Node Managers with App Master/Container, MapReduce Status/Job Submission/Node Status/Resource Request flow legend)
YARN is like separating a restaurant's general manager (who just allocates tables, staff, and kitchen time — Resource Manager) from each specific event's own event coordinator (Application Master) who requests exactly what that event needs. This lets the restaurant handle weddings, birthday parties, AND walk-in customers (batch, interactive, streaming) all at once instead of only one type of event.
Hadoop Execution (YARN)
- Client submits an application to the Resource Manager
- Resource Manager asks a Node Manager to create an Application Master instance and starts it up
- Application Manager initializes itself and registers with the Resource Manager
- Application manager figures out how many resources are needed to execute the application
- The Application Master then requests the necessary resources from the Resource Manager. It sends a heartbeatmessage to the Resource Manager throughout its lifetime
- The Resource Manager accepts the request and queues it up
- As the requested resources become available on the slave nodes, the Resource Manager grants the Application Master leases for containers on specific slave nodes
[Image] — YARN execution diagram (Client, Resource Manager/Job History Server on Master Node, Node Managers with Application Master/Containers on Slave Nodes)
YARN – Web Management
- Runs on port 8088
- Shows: All Applications, Cluster Metrics (Apps Submitted/Pending/Running/Completed, Containers Running, Memory Used/Total/Reserved, VCores Used/Total/Reserved, Active Nodes), Scheduler Metrics
[Image] — YARN Web UI "All Applications" screenshot showing a table of application IDs, users, names, types (TEZ, SPARK), queues, states
- YARN Nodes view: shows Node Labels, Rack, Node State, Node Address, Health, Containers, Mem Used/Avail, VCores Used/Avail, Version
[Image] — YARN Web UI "Nodes of the cluster" screenshot
- Select Application: shows Application Overview (User, Name, Type, Priority, State, Queue, Final Status, Started, Elapsed, Tracking URL, Log Aggregation Status, Diagnostics), Application Metrics, and Attempt details
[Image] — YARN Web UI Application detail screenshot (Kill Application view, Application Overview and Metrics tables, Attempt ID table)
Hadoop Distribution
- Open-source (Free)
- Apache Hadoop (Vanilla version)
- Apache Ambari with Hadoop
- Paid License
- Cloudera
- Hortonworks Data Platform
- Cloud-based
- Amazon EMR
- Azure HDInsight
[Image] — Logos for Apache Hadoop, Apache Ambari, Cloudera, Hortonworks Data Platform (HDP), Amazon EMR, Azure HDInsight
Apache Hadoop
- The Apache™ Hadoop® project develops open-source software for reliable, scalable, distributed computing. It includes Hadoop Common, HDFS, YARN, MapReduce
- Website: https://hadoop.apache.org/
- Environment required for Hadoop:
- The production environment of Hadoop is UNIX
- Java Installation (version 8)
- SSH installation (Use SSH key, no password)
- Hadoop Installation and File Configuration:
core-site.xmlhdfs-site.xmlyarn-site.xmlmapred-site.xml
[Image] — Apache Hadoop logo
Ambari Web Management For Hadoop
- The Apache Ambari project is aimed at making Hadoop management simpler by developing software for provisioning, managing, and monitoring Apache Hadoop clusters
- Ambari provides an intuitive, easy-to-use Hadoop management web UI backed by its RESTful APIs
- Website: https://ambari.apache.org/
[Image] — Ambari architecture diagram (Ambari Web, Ambari Server with DB, Agents on Hosts; and expanded view with REST API, Request Dispatcher, Orchestrator, Monitoring, Auth Provider, Ambari Agents, Metrics Providers, Configurable Auth Provider connecting to User Repo: RDBMS, LDAP, AD)
[Image] — Ambari Web Management dashboard screenshot (HDFS, YARN, MapReduce2, services list; Summary, Metrics: Memory Utilization, CPU Utilization, Container Failures, App Failures, Pending Apps, Cluster Memory/Disk/Network/CPU)
- Supports version management of configuration
[Image] — Ambari Configs screenshot showing version history (V14, V13, V12, V11, V6) with NameNode/DataNode directory and heap size settings
Cloudera Data Platform (CDP)
- A hybrid data platform designed for unmatched freedom to choose—any cloud, any analytics, any data
- CDP delivers faster and easier data management and data analytics for data anywhere, with optimal performance, scalability, and security
- Website: https://www.cloudera.com/products/cloudera-data-platform.html
- Expensive but famous among enterprise
[Image] — CDP architecture diagram (Management Console/Replication Manager/Workload Manager; Data Services: Data Engineering, Data Warehouse, Machine Learning; Cloudera SDX: Metadata/Security/Encryption/Control/Governance; Data Clusters: NiFi, Kafka, Flink, Spark, Impala, Hive, HBase; File Storage: HDFS; Object Storage: Ozone; CDP Private Cloud Base) and Cloudera Manager dashboard screenshot
The Hortonworks Data Platform (HDP)
- A security-rich, enterprise-ready, open-source Apache Hadoop distribution based on a centralized architecture (YARN)
- HDP addresses the needs of data at rest, powers real-time customer applications, and delivers robust analytics that help accelerate decision making and innovation (GUI based on Ambari)
- Very famous in the past, but now occupied by Cloudera and no longer open-source
[Image] — HDP version history/component matrix diagram (HDP 2.0–2.6, showing versions of Pig, Hive, Druid, Tez, Solr, Spark, Zeppelin, Slider, HBase, Phoenix, Accumulo, Storm, Falcon, Atlas, Sqoop, Flume, Kafka, Ambari, Zookeeper, Oozie, Knox, Ranger)
AWS: Elastic MapReduce (EMR)
- Amazon EMR provides a managed Hadoop framework that makes it easy, fast, and cost-effective to process vast amounts of data across dynamically scalable Amazon EC2 instances
- Includes: HDFS, EMRFS, YARN, HIVE, SPARK
[Image] — Amazon EMR cluster diagram (Cluster of Node/EC2 instances, connected to Amazon EC2 and Amazon S3; expanded view showing Master Node with Name Node/YARN Resource Manager, Core Node with Data Node/YARN Node Manager/Application Master/Executors, Task Node with Executors/Task)
Azure HDInsight
- A managed, full-spectrum, open-source analytics service in the cloud for enterprises
- With HDInsight, you can use open-source frameworks such as Apache Spark, Apache Hive, LLAP, Apache Kafka, and more, in your Azure environment
[Image] — Azure HDInsight architecture diagram (Data sources: Clickstream logs, DB, Sensors/social/weather → Apache Hadoop on HDInsight (ETL) → Apache Spark on HDInsight / Interactive Query on HDInsight ↔ Azure Storage / Azure Data Lake Store → AtScale BI Models → PowerBI visualization)
Setting a Hadoop Cluster
- "Commodity" does not mean "low-end."
- Processor: Quad-core, 2-2.5GHz CPUs
- Memory: 8-16GB RAM
- Storage: 4 x 2TB SATA disks (NO RAID!)
- Network: Gigabit Ethernet (2.5Gbps if possible)
- OS & Software
- Linux OS 64-Bit: CentOS 7 (Windows, Mac OS: not for production)
- Java Version 6+
- SSH with key authorization
- One Hadoop user for all cluster nodes
- File system: EXT3, NoAccessTime
Notice HDFS relies on its own software-level replication for fault tolerance, so using RAID (hardware-level redundancy) on data nodes is redundant/wasteful — that's why "NO RAID!" is emphasized for slave storage disks.
[Image] — Photo of a physical server rack for Hadoop cluster
Network Diagram for Hadoop Cluster
- Cluster specs: CPU: 24 Cores (8×3pc), Memory: 48GB (16×3pc), Total HDFS Storage: 15TB (5TB×3pc) (Replicate 2)
[Image] — Network diagram showing Hadoop Cluster (H1-H4 nodes connected via Gigabit Switch SW1) and W1 (Remote PC/Anonymization/Visualization) connected to Internet via VPN/SSL
Hardware Information
- SW1: Gigabit Switch (10/100/1000) for connecting among nodes
- W1: Remote PC & Anonymization & Visualization (CPU 8 Cores, Ram 16GB, Disk 2TB)
- H1: Hadoop Master Node (CPU 8 Cores, Ram 16GB, Disk 2TB, Raid is preferable)
- H2-4: Hadoop Slave Nodes (CPU 8 Cores, Ram 16GB, Disk 2TB × 3)
- For the machines, either physical hardware or virtual machine is ok
H1: Hadoop Master Node
Hardware
- Dell PowerEdge T140 Tower Server
- Intel Xeon E-2278G 3.4GHz, 16M cache, 8C/16T
- 16GB 2666MT/s DDR4 ECC UDIMM
- PERC H330 RAID Controller
- (2) 2TB 7.2K RPM Hard Drive, Raid 1 is preferable
- 1 Gigabit LAN port
Operating System
- CentOS 7
- Software Selection: Base Environment: GNOME Desktop
[Image] — CentOS 7 installation summary screenshot
SSH/SFTP Server
- OpenSSH Server
- Automatic install by default
Hadoop Software
- Hortonworks Data Platform with Apache Ambari (HDP 2.6.5)
- Both Ambari Server and Agent
Disk Allocation (manual allocation)
| Partition | Purpose |
|---|---|
/boot | Boot partition |
/swap | Swap partition |
/ | Root partition — all remaining spaces, Partition Type: EXT4, don't create /home |
Network Allocation
| Port | Configuration |
|---|---|
| Port 1 (for Internal) Gigabit | Internal network, Private IP, IP address: 192.168.77.11, Subnet mask: 255.255.255.0, Gateway: 192.168.77.1 |
| Port 2 | Not used |
H2-H4: Hadoop Slave Node
Hardware
- Dell PowerEdge T140 Tower Server
- Intel Xeon E-2278G 3.4GHz, 16M cache, 8C/16T
- 16GB 2666MT/s DDR4 ECC UDIMM
- PERC H330 RAID Controller
- (3) 2TB 7.2K RPM SATA Hard Drive, NO RAID
- 1 Gigabit LAN port
Operating System
- CentOS 7
- Software Selection: Base Environment: GNOME Desktop
[Image] — CentOS 7 installation summary screenshot
SSH/SFTP Server
- OpenSSH Server
- Automatic install by default
Hadoop Software
- Apache Ambari Agent
Disk Allocation (manual allocation)
| Disk | Purpose |
|---|---|
Disk 1 (OS) [/dev/sda] | /boot: Boot partition; /swap: Swap partition; /: Root partition (all remaining spaces), Partition Type: EXT4, don't create /home |
Disk 2 (Data) [/dev/sdb] | /disk2, Partition Type: EXT4 |
Disk 3 (Data) [/dev/sdc] | /disk3, Partition Type: EXT4 |
Network Allocation
| Port | Configuration |
|---|---|
| Port 1 (for Internal) Gigabit | Internal network, Private IP — H2: 192.168.77.12, H3: 192.168.77.13, H4: 192.168.77.14, Subnet mask: 255.255.255.0, Gateway: 192.168.77.1 |
| Port 2 | Not used |
W1: Windows for Remote, Jump Host
Hardware
- Dell PowerEdge T140 Tower Server
- Intel Xeon E-2278G 3.4GHz, 16M cache, 8C/16T
- 16GB 2666MT/s DDR4 ECC UDIMM
- PERC H330 RAID Controller
- (2) 2TB 7.2K RPM Hard Drive, Raid 1 is preferable
- 1 Gigabit LAN port
Operating System
- Microsoft Windows Server Standard 64bit
SSH/SFTP Server
- Commercial SFTP server named bitvise
- License required, about 100 USD per machine
- Website: https://www.bitvise.com/ssh-server
Software
- Anonymization Software
- Windows RDP
Remote Access
- VPN?
- RDP?
- AnyDesk?
Disk Allocation
| Drive | Purpose |
|---|---|
| C: (OS) | System Disk for Operating System, Install Windows, 150 GB |
| D: (DATA) | For keeping data, Total Remaining disk, 850 GB |
Network Allocation
| Port | Configuration |
|---|---|
| Port 1 (for Internet) Gigabit | Public Network, Fixed Public IP, Require Internet Access, IP: xxx.xxx.xxx.xxx |
| Port 2 (for Internal) Gigabit | Internal network, Private IP, IP address: 192.168.77.1 |
W1 acts like a "jump host" or front gate guard — the only machine exposed to the public internet, standing between the outside world and the private internal Hadoop cluster network.
Gigabit Managed Switch
Hardware
- Gigabit Switch with minimum 8 ports
- Support Web Management is preferable
- Ex: CISCO SG350-10
Switch IP
- Managed IP: 192.168.77.1
[Image] — Photo of CISCO SG350-10 switch, and CAT6 (1 Gigabit, 2.5G also ok) and CAT7 (10 Gigabit) cable photos
The "Data Lake"
[Image] — Data lake process diagram: "Ingest all data regardless of requirements" → "Store all data in native format without schema definition" → "Do analysis using analytic engines like Hadoop", with data sources (Devices, Social, LOB applications, Video, Web, Sensors, Relational, Clickstream) flowing into a lake, then out to Batch queries, Interactive queries, Real-time analytics, Machine Learning, Data warehouse → Dashboards/Reports/Exploration
What is Data Lake?
- A storage repository, usually Hadoop, that holds a vast amount of raw data in its native format until it is needed
- A place to store unlimited amounts of data in any format inexpensively, especially for archive purposes
- Allows collection of data that you may or may not use later: "just in case"
- A way to describe any large data pool in which the schema and data requirements are not defined until the data is queried: "just in time" or "schema on read"
- Complements EDW (Enterprise Data Warehouse) and can be seen as a data source for the EDW — capturing all data but only passing relevant data to the EDW
- Frees up expensive EDW resources (storage and processing), especially for data refinement
- Allows for data exploration to be performed without waiting for the EDW team to model and load the data (quick user access)
- Some processing is better done with Hadoop tools than ETL tools like SSIS
- Easily scalable
A Data Lake is like a giant, cheap storage warehouse where you just dump every box (data) as it arrives without sorting it first ("just in case" you need it later). A Data Warehouse, by contrast, is like a neatly organized retail store where every item must be labeled, categorized, and shelved (structured, schema-defined) before it's put away.
Data Lake vs Data Warehouse
| DATA WAREHOUSE | DATA LAKE | |
|---|---|---|
| DATA | structured, processed | structured / semi-structured / unstructured, raw |
| PROCESSING | schema-on-write | schema-on-read |
| STORAGE | expensive for large data volumes | designed for low-cost storage |
| AGILITY | less agile, fixed configuration | highly agile, configure and reconfigure as needed |
| SECURITY | mature | maturing |
| USERS | business professionals | data scientists et al. |
AWS Data Lake
[Image] — AWS Data Lake architecture diagram: Data Sources (Files, RDBMS, Streaming) → Ingest (Direct Connect, Snowball, Kinesis) → Central Data Store (S3 Primary, Redshift Data warehouse) → Process & Analyze (QuickSight, Machine Learning, EMR, Lambda, Glue, Athena) → Consumers & Partners (Tableau); all governed by Govern & Secure layer (Catalog & User Interface: DynamoDB, ElasticSearch, Web Interface; Access Management: API Gateway, IAM & Cognito)
Summary
- Hadoop Ecosystem
- HDFS (Distributed File System)
- Data Flow
- Common Command
- Hadoop File Formats
- YARN (Yet Another Resource Negotiator)
- Hadoop Execution
- Hadoop Distribution
- Setup Hadoop Cluster
- CPU, Memory
- Storage, Network
- OS
- Data Lake
Linked from
- 09 File System
- Chapter 10 - Apache PIG, HIVE, ZooKeeper
- Chapter 12 - Requirements for Secure, Multi-Tenant Hadoop (Apache YARN)
- Chapter 3-2 - Distributed File Storage System - HDFS
- Chapter 9 - Access Control (Authorization)
- Lecture 1 - Introduction
- Lecture 2 - Data and Data Management
- Lecture 3 - Data and Data Management II
- Lecture 6 - MapReduce Framework and Programming