Overview
Ceph is a highly scalable, unified distributed storage system that provides object, block, and file storage in a single platform. Designed to be completely open-source, massively scalable, and software-defined, Ceph delivers enterprise-grade storage capabilities without vendor lock-in or expensive proprietary hardware requirements.
At its core, Ceph uses the CRUSH algorithm (Controlled Replication Under Scalable Hashing) to intelligently distribute data across storage nodes. This eliminates single points of failure and bottlenecks, allowing the system to scale from terabytes to exabytes while maintaining high performance and reliability. The self-healing and self-managing capabilities mean that Ceph automatically rebalances data when nodes are added or removed, and recovers from hardware failures without manual intervention.
Ceph's architecture consists of several key components: Object Storage Daemons (OSDs) that store actual data on disks, Monitors (MONs) that maintain cluster state and consensus, Managers (MGRs) that provide monitoring and management interfaces, and Metadata Servers (MDSs) for CephFS file system operations. This modular design ensures that each component can scale independently based on workload requirements.
One of Ceph's most powerful features is its ability to provide multiple storage interfaces from the same cluster. RADOS Block Device (RBD) offers thin-provisioned block storage with snapshots and cloning, perfect for virtual machines and databases. CephFS provides a POSIX-compliant distributed file system with strong consistency guarantees. The RADOS Gateway (RGW) delivers S3 and Swift-compatible object storage for applications and cloud-native workloads.
Ceph integrates seamlessly with cloud platforms like OpenStack, Kubernetes, and Proxmox VE, making it an ideal storage backend for virtualization and container environments. With features like erasure coding for space efficiency, tiering for hot/cold data, quality of service controls, and multi-site replication for disaster recovery, Ceph provides enterprise storage capabilities at a fraction of the cost of traditional SAN or NAS solutions.
The active open-source community, backed by Red Hat and the Ceph Foundation, ensures continuous development, regular updates, and extensive documentation. Whether you're building a private cloud, running a Kubernetes cluster, or managing large-scale media archives, Ceph delivers the performance, reliability, and flexibility needed for modern data-intensive applications.
Key Features
Unified Storage Platform
Single cluster provides object, block, and file storage with consistent management and monitoring
Massive Scalability
Scale from gigabytes to exabytes by simply adding more nodes without downtime or data migration
Self-Healing Architecture
Automatically detects failures, replicates data, and rebalances cluster without manual intervention
No Single Point of Failure
Distributed architecture with CRUSH algorithm ensures high availability and fault tolerance
Multi-Protocol Support
Native support for RBD block storage, CephFS filesystem, and S3/Swift object storage APIs
Enterprise Features
Snapshots, cloning, thin provisioning, erasure coding, tiering, and multi-site replication
Gunakan Kes
• **OpenStack Storage Backend**: Provide block and object storage for OpenStack Glance (images), Cinder (volumes), and Nova (instances)
• **Kubernetes Persistent Volumes**: Dynamic provisioning of RBD block devices for containerized applications with CSI driver
• **Private Cloud Storage**: Build scalable storage infrastructure for VM disk images and application data
• **Media and Archive Storage**: Store large video files, backups, and archives with erasure coding for space efficiency
• **High-Performance Computing**: Parallel file system for scientific computing and data analytics workloads
• **Database Storage**: RBD block devices for MySQL, PostgreSQL, and MongoDB with snapshot and replication capabilities
• **Backup Repository**: Cost-effective long-term backup storage with S3-compatible object storage interface
Installation Guide
**Installation on Ubuntu 22.04 LTS (3-Node Cluster):**
**Prerequisites (All Nodes):**
```bash
# Update system
sudo apt update && sudo apt upgrade -y
# Set hostnames (on each node)
sudo hostnamectl set-hostname ceph-node1 # ceph-node2, ceph-node3
```
**1. Install Cephadm (Bootstrap Node):**
```bash
# Install dependencies
sudo apt install -y python3 python3-pip curl
# Download cephadm
curl --silent --remote-name --location https://github.com/ceph/ceph/raw/quincy/src/cephadm/cephadm
chmod +x cephadm
# Install cephadm
sudo ./cephadm add-repo --release quincy
sudo ./cephadm install
```
**2. Bootstrap Cluster (Node 1):**
```bash
# Bootstrap first node
sudo cephadm bootstrap --mon-ip 10.0.0.10 --cluster-network 10.0.1.0/24
# Save output - contains dashboard URL and admin password
# Dashboard: https://ceph-node1:8443/
# Username: admin
# Password: <generated-password>
```
**3. Add Additional Nodes:**
```bash
# Copy SSH key to other nodes
ssh-copy-id root@ceph-node2
ssh-copy-id root@ceph-node3
# Add hosts to cluster
sudo ceph orch host add ceph-node2 10.0.0.11
sudo ceph orch host add ceph-node3 10.0.0.12
# Label nodes for specific roles
sudo ceph orch host label add ceph-node1 mon
sudo ceph orch host label add ceph-node2 mon
sudo ceph orch host label add ceph-node3 mon
```
**4. Deploy MON and MGR Daemons:**
```bash
# Deploy monitors (3 for quorum)
sudo ceph orch apply mon --placement="3 ceph-node1 ceph-node2 ceph-node3"
# Deploy managers (2 for HA)
sudo ceph orch apply mgr --placement="2 ceph-node1 ceph-node2"
```
**5. Add OSD Storage:**
```bash
# List available devices
sudo ceph orch device ls
# Add all available devices as OSDs
sudo ceph orch apply osd --all-available-devices
# Or add specific devices
sudo ceph orch daemon add osd ceph-node1:/dev/sdb
sudo ceph orch daemon add osd ceph-node2:/dev/sdb
sudo ceph orch daemon add osd ceph-node3:/dev/sdb
```
**6. Deploy MDS for CephFS (Optional):**
```bash
# Create CephFS
sudo ceph fs volume create cephfs --placement="2 ceph-node1 ceph-node2"
```
**7. Enable Dashboard:**
```bash
# Enable dashboard module
sudo ceph mgr module enable dashboard
# Create dashboard admin user
sudo ceph dashboard ac-user-create admin <password> administrator
# Check dashboard status
sudo ceph mgr services
```
**8. Create RBD Pool for Block Storage:**
```bash
# Create replicated pool (3 replicas)
sudo ceph osd pool create rbd 64 64
# Enable RBD application
sudo ceph osd pool application enable rbd rbd
# Initialize pool
sudo rbd pool init rbd
```
**9. Verify Cluster Health:**
```bash
# Check cluster status
sudo ceph -s
# Check OSD status
sudo ceph osd status
# Check MON status
sudo ceph mon stat
```
Configuration Tips
**Essential Configuration:**
1. **Pool Configuration:**
```bash
# Create replicated pool (size=3, min_size=2)
ceph osd pool create mypool 128 128
ceph osd pool set mypool size 3
ceph osd pool set mypool min_size 2
# Create erasure-coded pool (k=4, m=2)
ceph osd erasure-code-profile set myprofile k=4 m=2
ceph osd pool create mypool-ec 128 128 erasure myprofile
```
2. **RBD Block Device Management:**
```bash
# Create RBD image (10GB)
rbd create mypool/myimage --size 10G
# List images
rbd ls mypool
# Map image to local device
sudo rbd map mypool/myimage
# Format and mount
sudo mkfs.ext4 /dev/rbd0
sudo mount /dev/rbd0 /mnt/ceph-disk
# Create snapshot
rbd snap create mypool/myimage@snap1
# Clone snapshot
rbd snap protect mypool/myimage@snap1
rbd clone mypool/myimage@snap1 mypool/clone1
```
3. **CephFS Mount (Client):**
```bash
# Install ceph-fuse
sudo apt install ceph-fuse
# Get admin keyring
sudo ceph auth get-or-create client.cephfs mon 'allow r' mds 'allow rw' osd 'allow rw pool=cephfs_data'
# Mount CephFS
sudo ceph-fuse -n client.cephfs /mnt/cephfs
# Or kernel mount
sudo mount -t ceph ceph-node1:6789:/ /mnt/cephfs -o name=cephfs,secret=<key>
```
4. **RADOS Gateway (S3/Swift):**
```bash
# Deploy RGW
ceph orch apply rgw myrgw --placement="2 ceph-node1 ceph-node2" --port=8080
# Create S3 user
radosgw-admin user create --uid=s3user --display-name="S3 User" --access-key=ACCESSKEY --secret-key=SECRETKEY
# Test with s3cmd
s3cmd --access_key=ACCESSKEY --secret_key=SECRETKEY --host=http://ceph-node1:8080 ls
```
5. **Performance Tuning:**
```bash
# Set scrub intervals (reduce I/O impact)
ceph osd set noscrub
ceph osd set nodeep-scrub
# Adjust backfill and recovery
ceph tell 'osd.*' injectargs '--osd-max-backfills 1'
ceph tell 'osd.*' injectargs '--osd-recovery-max-active 1'
# Enable RBD caching
rbd config global set rbd_cache true
rbd config global set rbd_cache_size 67108864 # 64MB
```
6. **Monitoring:**
```bash
# Check cluster health
ceph health detail
# Monitor real-time stats
ceph -w
# Check pool usage
ceph df
# Check OSD performance
ceph osd perf
# View PG statistics
ceph pg stat
```
**Best Practices:**
- Use separate networks for public and cluster traffic
- Deploy monitors on dedicated lightweight nodes
- Use SSDs for OSD journals/WAL and BlueStore metadata
- Configure at least 3 replicas or erasure coding k+m≥3
- Regular scrubbing and deep-scrubbing for data integrity
- Monitor IOPS, latency, and network bandwidth
- Use CRUSH rules to distribute data across failure domains
- Enable dashboard and Prometheus metrics for monitoring