Este conteúdo não está disponível no idioma selecionado.
Chapter 2. Configuring logging
This chapter describes how to configure logging for various Ceph subsystems.
Logging is resource intensive. Also, verbose logging can generate a huge amount of data in a relatively short time. If you are encountering problems in a specific subsystem of the cluster, enable logging only of that subsystem. See Section 2.1, “Ceph subsystems” for more information.
In addition, consider setting up a rotation of log files. See Section 2.4, “Accelerating log rotation” for details.
Once you fix any problems you encounter, change the subsystems log and memory levels to their default values. See Appendix A, Ceph subsystems default logging level values for a list of all Ceph subsystems and their default values.
You can configure Ceph logging by:
-
Using the
ceph
command at runtime. This is the most common approach. See Section 2.2, “Configuring logging at runtime” for details. - Updating the Ceph configuration file. Use this approach if you are encountering problems when starting the cluster. See Section 2.3, “Configuring logging in configuration file” for details.
Prerequisites
- A running Red Hat Ceph Storage cluster.
2.1. Ceph subsystems Copiar o linkLink copiado para a área de transferência!
This section contains information about Ceph subsystems and their logging levels.
Understanding Ceph Subsystems and Their Logging Levels
Ceph consists of several subsystems.
Each subsystem has a logging level of its:
-
Output logs that are stored by default in
/var/log/ceph/CLUSTER_FSID/
directory (log level) - Logs that are stored in a memory cache (memory level)
In general, Ceph does not send logs stored in memory to the output logs unless:
- A fatal signal is raised
- An assert in source code is triggered
- You request it
You can set different values for each of these subsystems. Ceph logging levels operate on a scale of 1
to 20
, where 1
is terse and 20
is verbose.
Use a single value for the log level and memory level to set them both to the same value. For example, debug_osd = 5
sets the debug level for the ceph-osd
daemon to 5
.
To use different values for the output log level and the memory level, separate the values with a forward slash (/
). For example, debug_mon = 1/5
sets the debug log level for the ceph-mon
daemon to 1
and its memory log level to 5
.
Subsystem | Log Level | Memory Level | Description |
---|---|---|---|
| 1 | 5 | The administration socket |
| 1 | 5 | Authentication |
| 0 | 5 |
Any application or library that uses |
| 1 | 5 | The BlueStore OSD backend |
| 1 | 5 | The OSD journal |
| 1 | 5 | The Metadata Servers |
| 0 | 5 | The Monitor client handles communication between most Ceph daemons and Monitors |
| 1 | 5 | Monitors |
| 0 | 5 | The messaging system between Ceph components |
| 0 | 5 | The OSD Daemons |
| 0 | 5 | The algorithm that Monitors use to establish a consensus |
| 0 | 5 | Reliable Autonomic Distributed Object Store, a core component of Ceph |
| 0 | 5 | The Ceph Block Devices |
| 1 | 5 | The Ceph Object Gateway |
Example Log Outputs
The following examples show the type of messages in the logs when you increase the verbosity for the Monitors and OSDs.
Monitor Debug Settings
debug_ms = 5 debug_mon = 20 debug_paxos = 20 debug_auth = 20
debug_ms = 5
debug_mon = 20
debug_paxos = 20
debug_auth = 20
Example Log Output of Monitor Debug Settings
OSD Debug Settings
debug_ms = 5 debug_osd = 20
debug_ms = 5
debug_osd = 20
Example Log Output of OSD Debug Settings
2.2. Configuring logging at runtime Copiar o linkLink copiado para a área de transferência!
You can configure the logging of Ceph subsystems at system runtime to help troubleshoot any issues that might occur.
Prerequisites
- A running Red Hat Ceph Storage cluster.
- Access to Ceph debugger.
Procedure
To activate the Ceph debugging output,
dout()
, at runtime:ceph tell TYPE.ID injectargs --debug-SUBSYSTEM VALUE [--NAME VALUE]
ceph tell TYPE.ID injectargs --debug-SUBSYSTEM VALUE [--NAME VALUE]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace:
-
TYPE
with the type of Ceph daemons (osd
,mon
, ormds
) -
ID
with a specific ID of the Ceph daemon. Alternatively, use*
to apply the runtime setting to all daemons of a particular type. -
SUBSYSTEM
with a specific subsystem. VALUE
with a number from1
to20
, where1
is terse and20
is verbose.For example, to set the log level for the OSD subsystem on the OSD named
osd.0
to 0 and the memory level to 5:ceph tell osd.0 injectargs --debug-osd 0/5
# ceph tell osd.0 injectargs --debug-osd 0/5
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
To see the configuration settings at runtime:
-
Log in to the host with a running Ceph daemon, for example,
ceph-osd
orceph-mon
. Display the configuration:
Syntax
ceph daemon NAME config show | less
ceph daemon NAME config show | less
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
[ceph: root@host01 /]# ceph daemon osd.0 config show | less
[ceph: root@host01 /]# ceph daemon osd.0 config show | less
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. Configuring logging in configuration file Copiar o linkLink copiado para a área de transferência!
Configure Ceph subsystems to log informational, warning, and error messages to the log file. You can specify the debugging level in the Ceph configuration file, by default /etc/ceph/ceph.conf
.
Prerequisites
- A running Red Hat Ceph Storage cluster.
Procedure
To activate Ceph debugging output,
dout()
at boot time, add the debugging settings to the Ceph configuration file.-
For subsystems common to each daemon, add the settings under the
[global]
section. For subsystems for particular daemons, add the settings under a daemon section, such as
[mon]
,[osd]
, or[mds]
.Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
For subsystems common to each daemon, add the settings under the
Additional Resources
- Ceph subsystems
- Configuring logging at runtime
- The Ceph Debugging and Logging Configuration Reference chapter in the Configuration Guide for Red Hat Ceph Storage 7
2.4. Accelerating log rotation Copiar o linkLink copiado para a área de transferência!
Increasing debugging level for Ceph components might generate a huge amount of data. If you have almost full disks, you can accelerate log rotation by modifying the Ceph log rotation file at /etc/logrotate.d/ceph-<fsid>
. The Cron job scheduler uses this file to schedule log rotation.
Prerequisites
- A running Red Hat Ceph Storage cluster.
- Root-level access to the node.
Procedure
Add the size setting after the rotation frequency to the log rotation file:
rotate 7 weekly size SIZE compress sharedscripts
rotate 7 weekly size SIZE compress sharedscripts
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example, to rotate a log file when it reaches 500 MB:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe size value can be expressed as '500 MB' or '500M'.
Open the
crontab
editor:crontab -e
[root@mon ~]# crontab -e
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add an entry to check the
/etc/logrotate.d/ceph-<fsid>
file. For example, to instruct Cron to check/etc/logrotate.d/ceph-<fsid>
every 30 minutes:30 * * * * /usr/sbin/logrotate /etc/logrotate.d/ceph-d3bb5396-c404-11ee-9e65-002590fc2a2e >/dev/null 2>&1
30 * * * * /usr/sbin/logrotate /etc/logrotate.d/ceph-d3bb5396-c404-11ee-9e65-002590fc2a2e >/dev/null 2>&1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.5. Creating and collecting operation logs for Ceph Object Gateway Copiar o linkLink copiado para a área de transferência!
User identity information is added to the operation log output. This is used to enable customers to access this information for auditing of S3 access. Track user identities reliably by S3 request in all versions of the Ceph Object Gateway operation log.
Procedure
Find where the logs are located:
Syntax
logrotate -f
logrotate -f
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
logrotate -f
[root@host01 ~]# logrotate -f /etc/logrotate.d/ceph-12ab345c-1a2b-11ed-b736-fa163e4f6220
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the logs within the specified location:
Syntax
ll LOG_LOCATION
ll LOG_LOCATION
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
ll /var/log/ceph/12ab345c-1a2b-11ed-b736-fa163e4f6220
[root@host01 ~]# ll /var/log/ceph/12ab345c-1a2b-11ed-b736-fa163e4f6220 -rw-r--r--. 1 ceph ceph 412 Sep 28 09:26 opslog.log.1.gz
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the current buckets:
Example
/usr/local/bin/s3cmd ls
[root@host01 ~]# /usr/local/bin/s3cmd ls
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a bucket:
Syntax
/usr/local/bin/s3cmd mb s3://NEW_BUCKET_NAME
/usr/local/bin/s3cmd mb s3://NEW_BUCKET_NAME
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
/usr/local/bin/s3cmd mb s3://bucket1
[root@host01 ~]# /usr/local/bin/s3cmd mb s3://bucket1 Bucket `s3://bucket1` created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the current logs:
Syntax
ll LOG_LOCATION
ll LOG_LOCATION
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
ll /var/log/ceph/12ab345c-1a2b-11ed-b736-fa163e4f6220
[root@host01 ~]# ll /var/log/ceph/12ab345c-1a2b-11ed-b736-fa163e4f6220 total 852 ... -rw-r--r--. 1 ceph ceph 920 Jun 29 02:17 opslog.log -rw-r--r--. 1 ceph ceph 412 Jun 28 09:26 opslog.log.1.gz
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Collect the logs:
Syntax
tail -f LOG_LOCATION/opslog.log
tail -f LOG_LOCATION/opslog.log
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow