Bookmark this page

Chapter 3. Configuring a Red Hat Ceph Storage Cluster

Abstract

Goal Manage the Red Hat Ceph Storage configuration, including the primary settings, the use of monitors, and the cluster network layout.
Objectives
  • Identify and configure the primary settings for the overall Red Hat Ceph Storage cluster.

  • Describe the purpose of cluster monitors and the quorum procedures, query the monitor map, manage the configuration database, and describe Cephx.

  • Describe the purpose for each of the cluster networks, and view and modify the network configuration.

Sections
  • Managing Cluster Configuration Settings (and Guided Exercise)

  • Configuring Cluster Monitors (and Guided Exercise)

  • Configuring Cluster Networking (and Guided Exercise)

Lab

Configuring a Red Hat Ceph Storage Cluster

Managing Cluster Configuration Settings

Objectives

After completing this section, you should be able to identify and configure the primary settings for the overall Red Hat Ceph Storage cluster.

Ceph Cluster Configuration Overview

All Red Hat Ceph Storage cluster configurations contain these required definitions:

  • Cluster network configuration

  • Cluster monitor (MON) configuration and bootstrap options

  • Cluster authentication configuration

  • Daemon configuration options

Ceph configuration settings use unique names that consist of lowercase character words connected with underscores.

Note

Configuration settings might contain dash or space characters when using some configuration methods. However, using underscores in configuration naming is a consistent, recommended practice.

Every Ceph daemon, process, and library accesses its configuration from one of these sources:

  • The compiled-in default value

  • The centralized configuration database

  • A configuration file that is stored on the local host

  • Environment variables

  • Command-line arguments

  • Runtime overrides

Important

Later settings override those found in earlier sources when multiple setting sources are present. The configuration file configures the daemons when they start. Configuration file settings override those stored in the central database.

The monitor (MON) nodes manage a centralized configuration database. On startup, Ceph daemons parse configuration options that are provided via command-line options, environment variables, and the local cluster configuration file. The daemons then contact the MON cluster to retrieve configuration settings that are stored in the centralized configuration database.

Red Hat Ceph Storage 5 deprecates the ceph.conf cluster configuration file, making the centralized configuration database the preferred way to store configuration settings.

Modifying the Cluster Configuration File

Each Ceph node stores a local cluster configuration file. The default location of the cluster configuration file is /etc/ceph/ceph.conf. The cephadm tool creates an initial Ceph configuration file with a minimal set of options.

The configuration file uses an INI file format, containing several sections that include configuration for Ceph daemons and clients. Each section has a name that is defined with the [name] header, and one or more parameters that are defined as a key-value pair.

[name]
parameter1 = value1
parameter2 = value2

Use a hash sign (#) or semicolon (;) to disable settings or to add comments.

Bootstrap a cluster with custom settings by using a cluster configuration file. Use the cephadm boostrap command with the --config option to pass the configuration file.

[root@node ~]# cephadm bootstrap --config ceph-config.yaml

Configuration Sections

Ceph organizes configuration settings into groups, whether stored in the configuration file or in the configuration database, using sections called for the daemons or clients to which they apply.

  • The [global] section stores general configuration that is common to all daemons or any process that reads the configuration, including clients. You can override [global] parameters by creating called sections for individual daemons or clients.

  • The [mon] section stores configuration for the Monitors (MON).

  • The [osd] section stores configuration for the OSD daemons.

  • The [mgr] section stores configuration for the Managers (MGR).

  • The [mds] section stores configuration for the Metadata Servers (MDS).

  • The [client] section stores configuration that applies to all the Ceph clients.

Note

A well-commented sample.ceph.conf example file can be found in /var/lib/containers/storage/overlays/{ID}/merged/usr/share/doc/ceph/ on any cluster node, the area where podman manages containerized service data.

Instance Settings

Group the settings that apply to a specific daemon instance in their own section, with a name of the form [daemon-type.instance-ID].

[mon]
# Settings for all mon daemons

[mon.serverc]
# Settings that apply to the specific MON daemon running on serverc

The same naming applies to the [osd], [mgr], [mds], and [client] sections. For OSD daemons, the instance ID is always numeric, for example [osd.0]. For clients, the instance ID is the active user name, such as [client.operator3].

Meta Variables

Meta variables are Ceph-defined variables. Use them to simplify the configuration.

$cluster

The name of the Red Hat Ceph Storage 5 cluster. The default cluster name is ceph.

$type

The daemon type, such as the value mon for a monitor. OSDs use osd, MDSes use mds, MGRs use mgr, and client applications use client.

$id

The daemon instance ID. This variable has the value serverc for the Monitor on serverc. $id is 1 for osd.1, and is the user name for a client application.

$name

The daemon name and instance ID. This variable is a shortcut for $type.$id.

$host

The host name on which the daemon is running.

Using the Centralized Configuration Database

The MON cluster manages and stores the centralized configuration database on the MON nodes. You can either change a setting temporarily, until the daemons restart, or configure a setting permanently and store it in the database. You can change most configuration settings while the cluster is running.

Use ceph config commands to query the database and view configuration information.

  • ceph config ls, to list all possible configuration settings.

  • ceph config help setting, for help with a particular configuration setting.

  • ceph config dump, to show the cluster configuration database settings.

  • ceph config show $type.$id, to show the database settings for a specific daemon. Use show-with-defaults to include default settings.

  • ceph config get $type.$id, to get a specific configuration setting.

  • ceph config set $type.$id, to set a specific configuration setting.

Use the assimilate-conf subcommand to apply configuration from a file to a running cluster. This process recognizes and applies the changed settings from the configuration file to the centralized database. This command is useful to import custom settings from a previous storage cluster to a new one. Invalid or unrecognized options display on standard output, and require manual handling. Redirect screen output to a file using the -o output-file.

[ceph: root@node /]# ceph config assimilate-conf -i ceph.conf

Cluster Bootstrap Options

Some options provide the information needed to start the cluster. MON nodes read the monmap to find other MONs and establish a quorum. MON nodes read the ceph.conf file to identify how to communicate with other MONs.

The mon_host option lists cluster monitors. This option is essential and cannot be stored in the configuration database. To avoid using a cluster configuration file, Ceph clusters support using DNS service records to provide the mon_host list.

The local cluster configuration file can contain other options to fit your requirements.

  • mon_host_override, the initial list of monitors for the cluster to contact to start communicating.

  • mon_dns_serv_name, the name of the DNS SRV record to check to identify the cluster monitors via DNS.

  • mon_data, osd_data, mds_data, mgr_data, define the daemon's local data storage directory.

  • keyring, keyfile, and key, the authentication credentials to authenticate with the monitor.

Using Service Configuration Files

Service configuration files are YAML files that bootstrap a storage cluster and additional Ceph services. The cephadm tool orchestrates the service deployment, sizing, and placement by balancing the running daemons in the cluster. Various parameters can deploy services such as OSDs or MONs in a more defined manner.

An example service configuration file follows.

service_type: mon
placement:
  host_pattern: "mon*"
  count: 3
---
service_type: osd
service_id: default_drive_group
placement:
  host_pattern: "osd*"
data_devices:
  all: true
  • service_type defines the type of service, such as mon, mds, mgr, or rgw.

  • placement defines the location and quantity of the services to deploy. You can define the hosts, host pattern, or label to select the target servers.

  • data_devices is specific to OSD services, supporting filters such as size, model, or paths.

Use the cephadm bootstrap --apply-spec command to apply the service configurations from the specified file.

[root@node ~]# cephadm bootstrap --apply-spec service-config.yaml

Overriding Configuration Settings at Runtime

You can change most cluster configuration settings while running. You can temporarily change a configuration setting while the daemon is running.

The ceph tell $type.$id config command temporarily overrides configuration settings, and requires that both the MONs and the daemon being configured are running.

Run this command from any cluster host configured to run ceph commands. Settings that are changed with this command revert to their original settings when the daemon restarts.

  • ceph tell $type.$id config get gets a specific runtime setting for a daemon.

  • ceph tell $type.$id config set sets a specific runtime setting for a daemon. When the daemon restarts, these temporary settings revert to their original values.

The ceph tell $type.$id config command can also accept wildcards to get or set the value on all daemons of the same type. For example, ceph tell osd.* config get debug_ms displays the value of that setting for all OSD daemons in the cluster.

You can use the ceph daemon $type.$id config command to temporarily override a configuration setting. Run this command on the cluster node where the setting is required.

The ceph daemon does not need to connect through the MONs. The ceph daemon command will still function even when the MONs are not running, which can be useful for troubleshooting.

  • ceph daemon $type.$id config get gets a specific runtime setting for a daemon.

  • ceph daemon $type.$id config set sets a specific runtime setting for a daemon. Temporary settings revert to their original values when their daemon restarts.

 

References

For more information, refer to the Red Hat Ceph Storage 5 Configuration Guide at https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/5/html-single/configuration_guide/index#the-basics-of-ceph-configuration

Revision: cl260-5.0-29d2128