Apache Celeborn Documentation
repository·main·Indexed 21 days ago
https://github.com/apache/celebornApache Celeborn is a high-performance, elastic service for managing intermediate shuffle, spilled, and result data for map-reduce engines like Spark, Flink, and MapReduce. It decouples computing from storage using a Master-Worker architecture and a push-based shuffle write mechanism. The documentation covers installation, Kubernetes deployment via Helm, integration with Big Data compute engines, and building from source.
What's inside Apache Celeborn
- Apache Celeborn is a service designed to improve the efficiency and elasticity of map-reduce engines by providing an elastic, high-efficiency management service for intermediate data, such as shuffle data, spilled data, and result data. It focuses primarily on shuffle data management through disaggregated computing and storage, push-based shuffle writes, and merged shuffle reads.
Monitor the Celeborn cluster
mainCeleborn provides two primary methods for monitoring the cluster state and performance:
- Prometheus metrics: For time-series data collection and alerting.
- REST API: For programmatic access to cluster information and status.
Handle Fetch failures and retries
mainWhen fetching chunks from a data file, the
ShuffleClientmanages failures through a retry mechanism:- Retry Limit: The
ShuffleClienthas a maximum number of retries per replica (defaults to3). - Replica Switching: If a fetch chunk fails, the
ShuffleClientattempts to try another replica. If replication is disabled, it retries the same replica. - Failure State: If the maximum number of retries is exceeded, the
ShuffleClientstops retrying and throws anException.
- Retry Limit: The
Disk health and capacity management in Workers
mainCeleborn
Workers perform periodic checks on disk health and usage to ensure stability:- Health Checks: If a disk health check fails, the
Workerisolates that disk and will not allocate slots on it until it returns to a healthy state. - Capacity Threshold: If usable space falls below a specific threshold (defaults to
5GiB), theWorkerwill stop allocating slots on that disk. - Preventing Overflow: To prevent exceeding available space, the
Workertriggers aHARD_SPLITfor allPartitionLocations on the disk to prevent further file size growth.
- Health Checks: If a disk health check fails, the
Understand configuration precedence and levels
mainDynamic configurations are applied at different levels. When multiple levels define the same key, the following order of precedence applies (from highest to lowest):
TENANT_USER: Specific to atenantIdand ausername. OverridesTENANTandSYSTEMlevels.TENANT: Specific to atenantId. OverridesSYSTEMlevel.SYSTEM: Global system-wide configuration. Overrides staticCelebornConf.- Static Configuration: The base configuration defined in
CelebornConf.
How the Celeborn shuffle process works
mainThe shuffle lifecycle follows these steps:
- Mappers lazily ask the
LifecycleManagertoregisterShuffle. LifecycleManagerrequests slots from the Master.- Workers reserve slots and create corresponding files.
- Mappers retrieve worker locations from the
LifecycleManager. - Mappers push data to the specified workers.
- Workers merge and replicate data to their peers.
- Workers periodically flush data to disk.
- Mapper tasks complete and trigger a
MapperEndevent. - Once all mapper tasks are complete, workers commit the files.
- Reducers request file locations.
- Reducers read the shuffle data.
- Mappers lazily ask the
How Celeborn achieves load balancing via Slots
mainCeleborn uses a logical concept called a Slot to achieve load balancing across workers. A Slot represents the capacity of a Celeborn Worker to hold partitions.
- Slot Count Calculation: The number of slots per worker is determined by
total usable disk size / average shuffle file size. - Lifecycle: A worker's slot count decreases when a partition is allocated and increments when a partition is freed.
- Slot Count Calculation: The number of slots per worker is determined by
Use TagsQL for advanced worker selection
mainTagsQL provides enhanced flexibility for selecting workers based on key-value pairs. To use it, set
celeborn.tags.useTagsQLtotruein theMasterconfiguration.Syntax Rules:
- Match single value:
key:value - Negate single value:
key:!value - Match list of values:
key:{value1,value2} - Negate list of values:
key:!{value1,value2}
Note: TagsQL only supports tags where key-value pairs are separated by an equal sign (
=) in the underlying data.Example:
env:production region:{us-east,us-west} env:!sandboxselects workers whereenvisproduction,regionis eitherus-eastorus-west, andenvis NOTsandbox.celeborn.tags.useTagsQL=true # Example expression: env:production region:{us-east,us-west} env:!sandbox- Match single value:
Understand the roles of the Celeborn Master
mainThe Celeborn
Masteris the central coordinator of the cluster. Its primary responsibilities include:- Cluster Status Management: Tracking the health and availability of all
Workernodes. - Shuffle Lifecycle Management: Maintaining active shuffles and cleaning up resources when applications fail.
- High Availability (HA): Ensuring the Master component remains resilient using the Raft consensus protocol.
- Slot Allocation: Distributing shuffle partition locations to available disks across the cluster using load-balancing strategies.
- Cluster Status Management: Tracking the health and availability of all
Ensure Celeborn client and engine version compatibility
mainWhile the Celeborn server is compatible with various engine clients, the Celeborn client must match the version of the engine you are running.
For example, if you are using Spark 3.2, you must compile the Celeborn client using the
-Pspark-3.2flag.How Congestion Control works in Celeborn Workers
mainCongestion Control is an optional mechanism used to slow down the data push rate from
ShuffleClients when memory pressure is high. It aims to achieve fairness by suppressing users who consume disproportionately high resources.Mechanism
- Identification: The
Workeruses aUserIdentifierto track the number of bytes pushed by each user in the last time window. - Trigger: When used direct memory exceeds the High Watermark, the
Workeridentifies "top users" (those who occupied more resources than the average) and sends them aCongestion Controlmessage. - Client Behavior: Upon receiving a
Congestion Controlmessage, theShuffleClientbehaves similarly to TCP Congestion Control:- Slow Start: An initial phase with a low push rate that increases rapidly.
- Congestion Avoidance: A phase where the push rate increases slowly after reaching a threshold.
- Recovery: If a
Congestion Controlmessage is received, the client reverts from Congestion Avoidance back to the Slow Start phase.
Configuration
Congestion Control can be enabled and tuned using the
celeborn.worker.congestionControl.*configuration prefix.- Identification: The
Use Async Push to prevent blocking compute engines
mainCeleborn supports asynchronous pushing via the
DataPushercomponent to ensure that the compute engine's execution is not blocked by shuffle I/O.Workflow:
- The compute engine calls
DataPusher#addTask. - A
PushTaskcontaining the data is created and added to a non-blocking queue. DataPushercontinuously polls the queue and invokesShuffleClient#pushDatato perform the actual transfer.
- The compute engine calls