O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Ceph Cookbook - Second Edition

Book Description

Over 100 effective recipes to help you design, implement, and troubleshoot manage the software-defined and massively scalable Ceph storage system.

About This Book

  • Implement a Ceph cluster successfully and learn to manage it.
  • Recipe based approach in learning the most efficient software defined storage system
  • Implement best practices on improving efficiency and security of your storage cluster
  • Learn to troubleshoot common issues experienced in a Ceph cluster

Who This Book Is For

This book is targeted at storage and cloud engineers, system administrators, or anyone who is interested in building software defined storage, to power your cloud or virtual infrastructure.

If you have basic knowledge of GNU/Linux and storage systems, with no experience of software defined storage solutions and Ceph, but eager to learn then this book is for you

What You Will Learn

  • Understand, install, configure, and manage the Ceph storage system
  • Get to grips with performance tuning and benchmarking, and learn practical tips to help run Ceph in production
  • Integrate Ceph with OpenStack Cinder, Glance, and Nova components
  • Deep dive into Ceph object storage, including S3, Swift, and Keystone integration
  • Configure a disaster recovery solution with a Ceph Multi-Site V2 gateway setup and RADOS Block Device mirroring
  • Gain hands-on experience with Ceph Metrics and VSM for cluster monitoring
  • Familiarize yourself with Ceph operations such as maintenance, monitoring, and troubleshooting
  • Understand advanced topics including erasure-coding, CRUSH map, cache pool, and general Ceph cluster maintenance

In Detail

Ceph is a unified distributed storage system designed for reliability and scalability. This technology has been transforming the software-defined storage industry and is evolving rapidly as a leader with its wide range of support for popular cloud platforms such as OpenStack, and CloudStack, and also for virtualized platforms. Ceph is backed by Red Hat and has been developed by community of developers which has gained immense traction in recent years.

This book will guide you right from the basics of Ceph , such as creating blocks, object storage, and filesystem access, to advanced concepts such as cloud integration solutions. The book will also cover practical and easy to implement recipes on CephFS, RGW, and RBD with respect to the major stable release of Ceph Jewel. Towards the end of the book, recipes based on troubleshooting and best practices will help you get to grips with managing Ceph storage in a production environment.

By the end of this book, you will have practical, hands-on experience of using Ceph efficiently for your storage requirements.

Style and approach

This step-by-step guide is filled with practical tutorials, making complex scenarios easy to understand.

Table of Contents

  1. Preface
    1. What this book covers
    2. What you need for this book
    3. Who this book is for
    4. Sections
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
      5. See also
    5. Conventions
    6. Reader feedback
    7. Customer support
      1. Downloading the example code
      2. Downloading the color images of this book
      3. Errata
      4. Piracy
      5. Questions
  2. Ceph – Introduction and Beyond
    1. Introduction
    2. Ceph – the beginning of a new era
      1. Software-defined storage – SDS
      2. Cloud storage
      3. Unified next-generation storage architecture
    3. RAID – the end of an era
      1. RAID rebuilds are painful
      2. RAID spare disks increases TCO
      3. RAID can be expensive and hardware dependent
      4. The growing RAID group is a challenge
      5. The RAID reliability model is no longer promising
    4. Ceph – the architectural overview
    5. Planning a Ceph deployment
    6. Setting up a virtual infrastructure
      1. Getting ready
      2. How to do it...
    7. Installing and configuring Ceph
      1. Creating the Ceph cluster on ceph-node1
      2. How to do it...
    8. Scaling up your Ceph cluster
      1. How to do it…
    9. Using the Ceph cluster with a hands-on approach
      1. How to do it...
  3. Working with Ceph Block Device
    1. Introduction
    2. Configuring Ceph client
      1.  How to do it...
    3. Creating Ceph Block Device
      1. How to do it...
    4. Mapping Ceph Block Device
      1. How to do it...
    5. Resizing Ceph RBD
      1. How to do it...
    6. Working with RBD snapshots
      1. How to do it...
    7. Working with RBD clones
      1. How to do it...
    8. Disaster recovery replication using RBD mirroring
      1. How to do it...
    9. Configuring pools for RBD mirroring with one way replication
      1. How to do it...
    10. Configuring image mirroring
      1. How to do it...
    11. Configuring two-way mirroring
      1. How to do it...
      2. See also
    12. Recovering from a disaster!
      1. How to do it...
  4. Working with Ceph and OpenStack
    1. Introduction
    2. Ceph – the best match for OpenStack
    3. Setting up OpenStack
      1. How to do it...
    4. Configuring OpenStack as Ceph clients
      1. How to do it...
    5. Configuring Glance for Ceph backend
      1. How to do it…
    6. Configuring Cinder for Ceph backend
      1. How to do it...
    7. Configuring Nova to boot instances from Ceph RBD
      1. How to do it…
    8. Configuring Nova to attach Ceph RBD
      1. How to do it...
  5. Working with Ceph Object Storage
    1. Introduction
    2. Understanding Ceph object storage
    3. RADOS Gateway standard setup, installation, and configuration
      1. Setting up the RADOS Gateway node
      2. How to do it…
      3. Installing and configuring the RADOS Gateway
      4. How to do it…
    4. Creating the radosgw user
      1. How to do it…
      2. See also…
    5. Accessing the Ceph object storage using S3 API
      1. How to do it…
      2. Configuring DNS
      3. Configuring the s3cmd client
        1. Configure the S3 client (s3cmd) on client-node1
    6. Accessing the Ceph object storage using the Swift API
      1. How to do it...
    7. Integrating RADOS Gateway with OpenStack Keystone
      1. How to do it...
    8. Integrating RADOS Gateway with Hadoop S3A plugin 
      1. How to do it...
  6. Working with Ceph Object Storage Multi-Site v2
    1. Introduction
    2. Functional changes from Hammer federated configuration
    3. RGW multi-site v2 requirement
    4. Installing the Ceph RGW multi-site v2 environment 
      1. How to do it...
    5. Configuring Ceph RGW multi-site v2
      1. How to do it...
        1. Configuring a master zone
        2. Configuring a secondary zone
        3. Checking the synchronization status 
    6. Testing user, bucket, and object sync between master and secondary sites
      1. How to do it...
  7. Working with the Ceph Filesystem
    1. Introduction
    2. Understanding the Ceph Filesystem and MDS
    3.  Deploying Ceph MDS
      1. How to do it...
    4. Accessing Ceph FS through kernel driver
      1. How to do it...
    5. Accessing Ceph FS through FUSE client
      1. How to do it...
    6. Exporting the Ceph Filesystem as NFS
      1. How to do it...
    7. Ceph FS – a drop-in replacement for HDFS
  8. Monitoring Ceph Clusters
    1. Introduction
    2. Monitoring Ceph clusters – the classic way
      1. How to do it...
        1. Checking the cluster's health
        2. Monitoring cluster events
        3. The cluster utilization statistics
        4. Checking the cluster's status
        5. The cluster authentication entries
      2. Monitoring Ceph MON
      3. How to do it...
        1. Checking the MON status
        2. Checking the MON quorum status
      4. Monitoring Ceph OSDs
      5. How to do it...
        1. OSD tree view
        2. OSD statistics
        3. Checking the CRUSH map
        4. Monitoring PGs
      6. Monitoring Ceph MDS
      7. How to do it...
    3. Introducing Ceph Metrics and Grafana
      1. collectd
      2. Grafana
    4. Installing and configuring Ceph Metrics with the Grafana dashboard
      1. How to do it...
    5. Monitoring Ceph clusters with Ceph Metrics with the Grafana dashboard
      1. How to do it ...
  9. Operating and Managing a Ceph Cluster
    1. Introduction
    2. Understanding Ceph service management
    3. Managing the cluster configuration file
      1. How to do it...
        1. Adding monitor nodes to the Ceph configuration file
        2. Adding an MDS node to the Ceph configuration file
        3. Adding OSD nodes to the Ceph configuration file
    4. Running Ceph with systemd
      1. How to do it...
        1. Starting and stopping all daemons
        2. Querying systemd units on a node
        3. Starting and stopping all daemons by type
        4. Starting and stopping a specific daemon
    5. Scale-up versus scale-out
    6. Scaling out your Ceph cluster
      1. How to do it...
        1. Adding the Ceph OSD
        2. Adding the Ceph MON
      2. There's more...
    7. Scaling down your Ceph cluster
      1. How to do it...
        1. Removing the Ceph OSD
        2. Removing the Ceph MON
    8. Replacing a failed disk in the Ceph cluster
      1. How to do it...
    9. Upgrading your Ceph cluster
      1. How to do it...
    10. Maintaining a Ceph cluster
      1. How to do it...
      2. How it works...
        1. Throttle the backfill and recovery:
  10. Ceph under the Hood
    1. Introduction
    2. Ceph scalability and high availability
    3. Understanding the CRUSH mechanism
    4. CRUSH map internals
      1. How to do it...
      2. How it works...
    5. CRUSH tunables
      1. The evolution of CRUSH tunables
        1. Argonaut – legacy
        2. Bobtail – CRUSH_TUNABLES2
        3. Firefly – CRUSH_TUNABLES3
        4. Hammer – CRUSH_V4
        5.  Jewel – CRUSH_TUNABLES5
      2. Ceph and kernel versions that support given tunables
      3. Warning when tunables are non-optimal
      4. A few important points
    6. Ceph cluster map
    7. High availability monitors
    8. Ceph authentication and authorization
      1. Ceph authentication
      2. Ceph authorization
      3. How to do it…
    9. I/O path from a Ceph client to a Ceph cluster
    10. Ceph Placement Group
      1. How to do it…
    11. Placement Group states
    12. Creating Ceph pools on specific OSDs
      1. How to do it...
  11. Production Planning and Performance Tuning for Ceph
    1. Introduction
    2. The dynamics of capacity, performance, and cost
    3. Choosing hardware and software components for Ceph
      1. Processor
      2. Memory
      3. Network
      4. Disk
      5. Partitioning the Ceph OSD journal
      6. Partitioning Ceph OSD data
      7. Operating system
      8. OSD filesystem
    4. Ceph recommendations and performance tuning
      1. Tuning global clusters
      2. Tuning Monitor
      3. OSD tuning
        1. OSD general settings
        2. OSD journal settings
        3. OSD filestore settings
        4. OSD recovery settings
        5. OSD backfilling settings
        6. OSD scrubbing settings
        7. Tuning the client
        8. Tuning the operating system
        9. Tuning the network
        10. Sample tuning profile for OSD nodes
      4. How to do it...
    5. Ceph erasure-coding
      1. Erasure code plugin
    6. Creating an erasure-coded pool
      1. How to do it...
    7. Ceph cache tiering
      1. Writeback mode
      2. Read-only mode
    8. Creating a pool for cache tiering
      1. How to do it...
      2. See also
    9. Creating a cache tier
      1. How to do it...
    10. Configuring a cache tier
      1. How to do it...
    11. Testing a cache tier
      1. How to do it...
    12. Cache tiering – possible dangers in production environments
      1. Known good workloads
      2. Known bad workloads
  12. The Virtual Storage Manager for Ceph
    1. Introductionc 
    2. Understanding the VSM architecture
      1. The VSM controller
      2. The VSM agent
    3. Setting up the VSM environment
      1. How to do it...
    4. Getting ready for VSM
      1. How to do it...
    5. Installing VSM
      1. How to do it...
    6. Creating a Ceph cluster using VSM
      1. How to do it...
    7. Exploring the VSM dashboard
    8. Upgrading the Ceph cluster using VSM
    9. VSM roadmap
    10. VSM resources
  13. More on Ceph
    1. Introduction
    2. Disk performance baseline
      1. Single disk write performance
      2. How to do it...
      3. Multiple disk write performance
      4. How to do it...
      5. Single disk read performance
      6. How to do it...
      7. Multiple disk read performance
      8. How to do it...
      9. Results
    3. Baseline network performance
      1. How to do it...
      2. See also
    4. Ceph rados bench
      1. How to do it...
      2. How it works...
    5. RADOS load-gen
      1. How to do it...
      2. How it works...
      3. There's more...
    6. Benchmarking the Ceph Block Device
      1. How to do it...
      2. How it works...
      3. See also
    7. Benchmarking Ceph RBD using FIO
      1. How to do it...
      2. See Also
    8. Ceph admin socket
      1. How to do it...
    9. Using the ceph tell command
      1. How to do it...
    10. Ceph REST API
      1. How to do it...
    11. Profiling Ceph memory
      1. How to do it...
    12. The ceph-objectstore-tool
      1. How to do it...
      2. How it works...
    13. Using ceph-medic
      1. How to do it...
      2. How it works...
      3. See also
    14. Deploying the experimental Ceph BlueStore
      1. How to do it...
      2. See Also
  14. An Introduction to Troubleshooting Ceph
    1. Introduction
    2. Initial troubleshooting and logging
      1. How to do it...
    3. Troubleshooting network issues
      1. How to do it...
    4. Troubleshooting monitors
      1. How to do it...
    5. Troubleshooting OSDs
      1. How to do it...
    6. Troubleshooting placement groups
      1. How to do it...
      2. There's more…
  15. Upgrading Your Ceph Cluster from Hammer to Jewel
    1. Introduction
    2. Upgrading your Ceph cluster from Hammer to Jewel
      1. How to do it...
        1. Upgrading the Ceph monitor nodes
        2. Upgrading the Ceph OSD nodes
        3. Upgrading the Ceph Metadata Server
      2. See also