第 17 章 日志记录和报告问题
以下小节描述了 Satellite 中最常用的日志文件和调试工具。
17.1. 增加日志记录级别以协助进行调试 复制链接链接已复制到粘贴板!
您可以提高 Satellite 组件的日志记录级别,以对 Satellite 进行故障排除。将日志记录级别增加到 debug 提供了更详细的信息。默认日志记录级别是 info。
17.1.1. 增加 Foreman 应用的日志记录级别 复制链接链接已复制到粘贴板!
为 Foreman 应用程序增加日志:
将日志记录级别设置为
debug:# satellite-installer --foreman-logging-level debug调试完成后,将日志记录级别重置为默认值:
# satellite-installer --reset-foreman-logging-level
有关 Satellite 日志记录设置的更多信息,请使用 satellite-installer 和 --full-help 选项:
# satellite-installer --full-help | grep logging
17.1.2. 增加 Hammer 的日志记录级别 复制链接链接已复制到粘贴板!
您可以在 ~/.hammer/log/hammer.log 中找到日志。
为 Hammer 增加日志记录:
-
在
/etc/hammer/cli_config.yml中,将:log_level:选项设置为debug:
:log_level: 'debug'
17.1.3. 增加胶囊的日志记录级别 复制链接链接已复制到粘贴板!
您可以在 /var/log/foreman-proxy/proxy.log 中找到日志。
为 Capsule 增加日志记录:
将日志记录级别设置为
debug:# satellite-installer --foreman-proxy-log-level DEBUG调试完成后,将日志记录级别重置为默认值:
# satellite-installer --reset-foreman-proxy-log-level
运行 satellite-installer 会将设置恢复为默认值。
17.1.4. 增加 Candlepin 的日志记录级别 复制链接链接已复制到粘贴板!
您可以在 /var/log/candlepin/candlepin.log 和 /var/log/candlepin/error.log 中找到日志。
为 Candlepin 增加日志记录:
在
/etc/candlepin/candlepin.conf中,将日志级别设置为DEBUG:log4j.logger.org.candlepin=DEBUG重启
tomcat服务:# systemctl restart tomcat
如果 candlepin 日志文件过于详细,您可以减少默认的调试级别:
log4j.logger.org.candlepin.resource.ConsumerResource=WARN
log4j.logger.org.candlepin.resource.HypervisorResource=WARN
17.1.5. 增加 Qpid Dispatch 路由器的日志级别 复制链接链接已复制到粘贴板!
Qpid 记录到 syslog。您可以查看日志 /var/log/messages 或 journalctl。
为 Qpid Dispatch 路由器增加日志记录:
在
/etc/qpid-dispatch/qdrouterd.conf中,将日志级别设置为debug:enable: debug+重启 Qpid Dispatch 路由器:
# systemctl restart qdrouterd
运行 satellite-installer 会将设置恢复为默认值。
17.1.6. 为 Qpid Broker 提高日志记录级别 复制链接链接已复制到粘贴板!
Qpid 记录到 syslog。您可以查看日志 /var/log/messages 或 journalctl。
增加 Qpid Broker 的日志记录:
在
/etc/qpid/qpidd.conf中,将日志级别设置为debug:log-enable=debug+重启 Qpid Broker:
# systemctl restart qpidd
运行 satellite-installer 会将设置恢复为默认值。
17.1.7. 为 Redis 增加日志记录级别 复制链接链接已复制到粘贴板!
您可以在 /var/log/redis/redis.log 中找到 Redis 的日志。
为 Redis 增加日志记录:
在
/etc/redis.conf中,将日志级别设置为debug:loglevel debug重启 Redis 服务:
# systemctl restart redis
运行 satellite-installer 会将设置恢复为默认值。
17.1.8. 为 Satellite 安装程序增加日志记录级别 复制链接链接已复制到粘贴板!
您可以在 /var/log/foreman-installer/ 中找到日志文件。
要增加 Satellite 安装程序的日志记录级别,请在安装过程中添加 --verbose-log-level debug 选项:
# satellite-installer --verbose-log-level debug
17.1.9. 为 Pulp 增加日志记录级别 复制链接链接已复制到粘贴板!
默认情况下,Pulp 会记录到 syslog。您可以查看日志 /var/log/messages 或 journalctl。
为 Pulp 增加日志记录:
在
/etc/pulp/settings.py中,将日志级别设置为DEBUG:LOGGING = {"dynaconf_merge": True, "loggers": {'': {'handlers': ['console'], 'level': 'DEBUG'}}}重启 Pulp 服务:
# systemctl restart \ pulpcore-api \ pulpcore-content \ pulpcore-resource-manager \ pulpcore-worker@1 \ pulpcore-worker@2 \ redis
17.1.10. 为 Puppet 代理增加日志记录级别 复制链接链接已复制到粘贴板!
您可以在 /var/log/puppetlabs/puppet/ 中找到日志。
为 Puppet 代理增加日志记录:
- 确保 Satellite 中启用了 Puppet。如需更多信息,请参阅在 Red Hat Satellite 中使用 Puppet 集成管理配置中的启用 Puppet 与 Satellite 集成。
将日志记录级别设置为
debug:# satellite-installer --puppet-agent-additional-settings log_level:debug
17.1.11. 为 Puppet 服务器增加日志记录级别 复制链接链接已复制到粘贴板!
您可以在 /var/log/puppetlabs/puppetserver/ 中找到日志。
增加 Puppet 服务器的日志记录:
- 确保 Satellite 中启用了 Puppet。如需更多信息,请参阅在 Red Hat Satellite 中使用 Puppet 集成管理配置中的启用 Puppet 与 Satellite 集成。
将日志记录级别设置为
debug:# satellite-installer --puppet-server-additional-settings log_level:debug重启 Puppet 服务器:
# satellite-maintain service restart --only puppetserver