LinuxCommandLibrary

ceph

Manage and monitor Ceph storage clusters

TLDR

Check cluster health status

$ ceph status
copy

Check cluster usage stats
$ ceph df
copy

Get the statistics for the placement groups in a cluster
$ ceph pg dump --format [plain]
copy

Create a storage pool
$ ceph osd pool create [pool_name] [page_number]
copy

Delete a storage pool
$ ceph osd pool delete [pool_name]
copy

Rename a storage pool
$ ceph osd pool rename [current_name] [new_name]
copy

Self-repair pool storage
$ ceph pg repair [pool_name]
copy

SYNOPSIS


ceph [global-options] <subcommand> [subcommand-options] [arguments]

Common invocations include:
ceph status
ceph health
ceph osd tree
ceph pg dump
ceph auth ls

PARAMETERS

global-options
    Options that apply to the ceph command itself, influencing connection, output format, or debug level.

--cluster <name>
    Specifies the Ceph cluster name to connect to (default is 'ceph').

--conf <path>
    Provides an alternative path to the Ceph configuration file (ceph.conf).

--name <user>, --id <user>
    Specifies the user ID (e.g., client.admin) for authentication.

--keyring <path>
    Specifies the path to the keyring file containing authentication keys.

--format <format>
    Sets the output format (e.g., json, yaml, plain). Useful for scripting.

--pretty
    Pretty-prints JSON or XML output for better human readability.

<subcommand>
    The core operation to perform (e.g., status, health, osd, pool, auth). Each subcommand has its own set of specific options and arguments.

subcommand-options
    Options specific to the chosen <subcommand>.

arguments
    Additional positional arguments required by the <subcommand>.

DESCRIPTION

The ceph command is the primary command-line interface (CLI) for administering and interacting with a Ceph distributed storage cluster. It allows administrators to query cluster status, manage storage pools, and control various Ceph services such as OSDs (Object Storage Daemons), MONs (Monitors), MDSs (Metadata Servers), and MGRs (Managers). It provides comprehensive insights into cluster health, performance metrics, and configuration settings. Through its rich set of subcommands, ceph enables essential tasks like creating and deleting pools, managing authentication keys, adjusting configuration parameters, monitoring placement groups (PGs), and initiating data scrub operations. It is an indispensable tool for daily operations, troubleshooting, and scaling Ceph deployments.

CAVEATS

Requires proper authentication (e.g., a keyring file with sufficient permissions) to connect to the Ceph cluster.
Many commands, especially those modifying cluster state, require administrative privileges.
Incorrect use of certain commands (e.g., osd rm, pool delete) can lead to data loss or cluster instability. Always understand the command's impact before execution.
Network connectivity to Ceph monitors is essential for the ceph CLI to function.

MANAGER MODULES

The ceph command provides interfaces to various ceph-mgr modules, enabling features like dashboards (ceph dashboard), telemetry (ceph telemetry), and Prometheus exports (ceph prometheus). These modules extend the management capabilities without requiring new binary installations.

OUTPUT FORMATS

The --format option is crucial for scripting and automation, allowing the output to be parsed programmatically in json, yaml, or xml formats, rather than human-readable plain text. The --pretty option further enhances readability for json and xml.

HISTORY

The ceph command is an integral part of the Ceph project, which began development by Sage Weil in 2004 as part of his PhD dissertation. It was open-sourced in 2007. The ceph CLI has evolved alongside the cluster itself, incorporating new subcommands and functionalities with each major release (e.g., Mimic, Nautilus, Octopus, Pacific, Quincy, Reef), reflecting the growing complexity and capabilities of the Ceph storage platform. It is continuously maintained and improved by the vibrant open-source community.

SEE ALSO

rados(8), rbd(8), ceph-mon(8), ceph-osd(8), ceph-mds(8), ceph-mgr(8), cephadm(8), mount.ceph(8)

Copied to clipboard