Abstract
| Goal | Manage the Red Hat Ceph Storage configuration, including the primary settings, the use of monitors, and the cluster network layout. |
| Objectives |
|
| Sections |
|
| Lab |
Configuring a Red Hat Ceph Storage Cluster |
After completing this section, you should be able to identify and configure the primary settings for the overall Red Hat Ceph Storage cluster.
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.
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
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.
Red Hat Ceph Storage 5 deprecates the ceph.conf cluster configuration file, making the centralized configuration database the preferred way to store configuration settings.
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.yamlCeph 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.
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.
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
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.
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 , for help with a particular configuration setting.setting
ceph config dump, to show the cluster configuration database settings.
ceph config show , to show the database settings for a specific daemon.
Use $type.$idshow-with-defaults to include default settings.
ceph config get , to get a specific configuration setting.$type.$id
ceph config set , to set a specific configuration setting.$type.$id
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.confSome 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.
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.yamlYou can change most cluster configuration settings while running. You can temporarily change a configuration setting while the daemon is running.
The ceph tell command temporarily overrides configuration settings, and requires that both the MONs and the daemon being configured are running.$type.$id config
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 gets a specific runtime setting for a daemon.$type.$id config get
ceph tell sets a specific runtime setting for a daemon.
When the daemon restarts, these temporary settings revert to their original values.$type.$id config set
The ceph tell command can also accept wildcards to get or set the value on all daemons of the same type.
For example, $type.$id configceph tell osd.* config get debug_ms displays the value of that setting for all OSD daemons in the cluster.
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 gets a specific runtime setting for a daemon.$type.$id config get
ceph daemon sets a specific runtime setting for a daemon.
Temporary settings revert to their original values when their daemon restarts.$type.$id config set
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