2.8. 컨테이너화된 Ceph 데몬의 파일에 로깅 활성화
기본적으로 컨테이너화된 Ceph 데몬은 파일에 기록하지 않습니다. 중앙 집중식 구성 관리를 사용하여 컨테이너화된 Ceph 데몬이 파일에 로그를 기록할 수 있습니다.
사전 요구 사항
- Red Hat Ceph Storage 소프트웨어 설치.
- 컨테이너화된 데몬이 실행되는 노드에 대한 루트 수준 액세스.
절차
var/log/ceph
디렉터리로 이동합니다.예제
[root@host01 ~]# cd /var/log/ceph
기존 로그 파일을 기록해 둡니다.
구문
ls -l /var/log/ceph/
예제
[root@host01 ceph]# ls -l /var/log/ceph/ total 396 -rw-r--r--. 1 ceph ceph 107230 Feb 5 14:42 ceph-osd.0.log -rw-r--r--. 1 ceph ceph 107230 Feb 5 14:42 ceph-osd.3.log -rw-r--r--. 1 root root 181641 Feb 5 14:42 ceph-volume.log
이 예제에서는 OSD.0 및 OSD.3용 파일에 로그인할 수 있습니다.
로깅을 활성화하려는 데몬의 컨테이너 이름을 가져옵니다.
Red Hat Enterprise Linux 7
[root@host01 ceph]# docker ps -a
Red Hat Enterprise Linux 8
[root@host01 ceph]# podman ps -a
중앙 집중식 구성 관리를 사용하여 Ceph 데몬의 파일에 로깅할 수 있습니다.
Red Hat Enterprise Linux 7
docker exec CONTAINER_NAME ceph config set DAEMON_NAME log_to_file true
Red Hat Enterprise Linux 8
podman exec CONTAINER_NAME ceph config set DAEMON_NAME log_to_file true
DAEMON_NAME 은 CONTAINER_NAME 에서 파생됩니다.
ceph-
를 제거하고 데몬 ID와 데몬 ID 간의 하이픈을 마침표로 바꿉니다.Red Hat Enterprise Linux 7
[root@host01 ceph]# docker exec ceph-mon-host01 ceph config set mon.host01 log_to_file true
Red Hat Enterprise Linux 8
[root@host01 ceph]# podman exec ceph-mon-host01 ceph config set mon.host01 log_to_file true
선택사항: 클러스터 로그의 파일에 로깅할 수 있도록 하려면
mon_cluster_log_to_file
옵션을 사용합니다.Red Hat Enterprise Linux 7
docker exec CONTAINER_NAME ceph config set DAEMON_NAME mon_cluster_log_to_file true
Red Hat Enterprise Linux 8
podman exec CONTAINER_NAME ceph config set DAEMON_NAME mon_cluster_log_to_file true
Red Hat Enterprise Linux 7
[root@host01 ceph]# docker exec ceph-mon-host01 ceph config set mon.host01 mon_cluster_log_to_file true
Red Hat Enterprise Linux 8
[root@host01 ceph]# podman exec ceph-mon-host01 ceph config set mon.host01 mon_cluster_log_to_file true
업데이트된 구성을 확인합니다.
Red Hat Enterprise Linux 7
docker exec CONTAINER_NAME ceph config show-with-defaults DAEMON_NAME | grep log_to_file
Red Hat Enterprise Linux 8
podman exec CONTAINER_NAME ceph config show-with-defaults DAEMON_NAME | grep log_to_file
예제
[root@host01 ceph]# podman exec ceph-mon-host01 ceph config show-with-defaults mon.host01 | grep log_to_file log_to_file true mon default[false] mon_cluster_log_to_file true mon default[false]
선택 사항: Ceph 데몬을 다시 시작합니다.
구문
systemctl restart ceph-DAEMON@DAEMON_ID
예제
[root@host01 ceph]# systemctl restart ceph-mon@host01
새 로그 파일이 있는지 확인합니다.
구문
ls -l /var/log/ceph/
예제
[root@host01 ceph]# ls -l /var/log/ceph/ total 408 -rw-------. 1 ceph ceph 202 Feb 5 16:06 ceph.audit.log -rw-------. 1 ceph ceph 3182 Feb 5 16:06 ceph.log -rw-r--r--. 1 ceph ceph 2049 Feb 5 16:06 ceph-mon.host01.log -rw-r--r--. 1 ceph ceph 107230 Feb 5 14:42 ceph-osd.0.log -rw-r--r--. 1 ceph ceph 107230 Feb 5 14:42 ceph-osd.3.log -rw-r--r--. 1 root root 181641 Feb 5 14:42 ceph-volume.log
모니터 데몬용
ceph-mon.host01.log
와 클러스터 로그에 대한ceph.log
의 새 파일이 생성되었습니다.
추가 리소스
- 자세한 내용은 Red Hat Ceph Storage 문제 해결 가이드의 로깅 구성 섹션을 참조하십시오.