Installing Ceph: A Detailed Guide

March 30, 2024

Ceph is a highly scalable, open-source storage platform that supports object, block, and file storage. It is designed to provide excellent performance, reliability, and scalability, making it an ideal choice for a wide range of applications. Installing Ceph involves several key steps, including installing Ceph packages on each node and configuring the cluster. This blog will guide you through the detailed process of installing Ceph on various Linux distributions.

Step 1: Preparing the Environment

Before installing Ceph, ensure that your environment meets the necessary requirements:

1. Hardware Requirements:

  • Nodes: A minimum of three monitor nodes (MONs) and three object storage daemon nodes (OSDs) for redundancy and fault tolerance.
  • Disks: SSDs for journaling and caching, and HDDs for bulk storage.
  • Network: A high-speed network, preferably a dedicated 10GbE network for Ceph traffic.

 

2. Software Requirements:

  • Operating System: Ceph supports various Linux distributions, including Ubuntu, CentOS, and Debian.
  • Dependencies: Ensure that required dependencies such as Python, OpenSSL, and other libraries are installed on each node.

Step 2: Installing Ceph Packages

Ceph can be installed using package managers available on your Linux distribution. The following sections provide steps for installing Ceph on Ubuntu and CentOS.

Installing Ceph on Ubuntu:

  1. Update the Package Repository:
    1. sudo apt update
    2. sudo apt upgrade -y
  2. Add the Ceph Repository:
    1. sudo apt install -y software-properties-common
    2. sudo add-apt-repository -y ppa:ceph/ceph
    3. sudo apt update
  3. Install Ceph Packages:
    1. sudo apt install -y ceph ceph-deploy

 

Installing Ceph on CentOS:

  1. Update the Package Repository:
    1. sudo yum update -y
  2. Add the Ceph Repository:
    1. sudo yum install -y centos-release-ceph
    2. sudo yum install -y epel-release
    3. sudo yum update -y
  3. Install Ceph Packages:
    1. sudo yum install -y ceph ceph-deploy

Step 3: Initial Configuration

Once the Ceph packages are installed on each node, the next step is to configure the cluster. This involves setting up Ceph configuration files and bootstrapping the cluster.

  1. Create a Directory for Ceph Configuration:
    1. mkdir my-cluster
    2. cd my-cluster
  2. Deploy a New Cluster:
    1. Use ceph-deploy to create a new cluster. Replace mon1, mon2, and mon3 with the hostnames of your monitor nodes.
    2. ceph-deploy new mon1 mon2 mon3
  3. Edit the Ceph Configuration File:
    1. Open the ceph.conf file created in the my-cluster directory and add any necessary configuration options. For example:
      1. [global]
        fsid = <your-fsid>
        mon_initial_members = mon1, mon2, mon3
        mon_host = <mon1-ip>,<mon2-ip>,<mon3-ip>
        public_network = <your-public-network>
        cluster_network = <your-cluster-network>
  4. Install Ceph on All Nodes:
    1. ceph-deploy install mon1 mon2 mon3 osd1 osd2 osd3
  5. Deploy the Initial Monitors and Gather Keys:
    1. ceph-deploy mon create-initial
    2. ceph-deploy gatherkeys mon1

Step 4: Adding OSDs to the Cluster

Object Storage Daemons (OSDs) are crucial for storing data, handling replication, and ensuring data durability. Adding OSDs to the cluster involves preparing the disks and then adding them to Ceph.

  1. Prepare the Disks: On each OSD node, prepare the disks. For example, if /dev/sdb is the disk you want to use:
    1. ceph-deploy osd prepare osd1:/dev/sdb
  2. Activate the OSDs:
    1. ceph-deploy osd activate osd1:/dev/sdb
  3. Repeat for All OSD Nodes:
    1. Perform the disk preparation and activation steps on all OSD nodes.

Step 5: Verifying the Cluster

After setting up the monitors and OSDs, verify that the cluster is functioning correctly.

  1. Check Cluster Status: On any Ceph node, run:
    1. ceph -s
    2. This command provides an overview of the cluster’s health, the number of OSDs, monitors, and the current status.
  2. Check OSD Status:
    1. ceph osd tree

This command shows the status of all OSDs in the cluster.

Step 6: Configuring Ceph Clients

Ceph supports various clients for accessing storage, including RADOS, RBD, and CephFS.

For RADOS:

  • Install the necessary libraries and tools on the client machine.
  • Use the rados command-line tool to interact with the object store.

For RBD:

  • Install the rbd package.
  • Map RBD images to local block devices using rbd map.

For CephFS:

  • Install the Ceph file system packages.
  • Mount the file system using ceph-fuse or the kernel client.

Conclusion

Installing Ceph involves several key steps, from preparing your environment and installing packages to configuring the cluster and adding OSDs. By following the detailed steps outlined in this blog, you can set up a robust, scalable, and high-performance Ceph cluster tailored to your storage needs. Remember that proper planning, hardware selection, and configuration are crucial to ensuring a successful Ceph deployment. With Ceph, you gain a versatile and reliable storage solution that can grow with your organization’s data demands.

 

Authors

Latest

From the blog

The latest industry news, interviews, technologies, and resources.

Case Studies
September 30, 2024

In late 2023, Clyso was approached by a cutting-edge company to transition their existing HDD-backed Ceph cluster to …

Introduction to Ceph Open Source
September 24, 2024

Introduction Overview of Ceph Ceph is a revolutionary open-source storage platform designed to provide unified, scalable, and highly …