Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

1.4.2.2. CRI-O のデバッグをオンにする

CRI-O のロギング機能の詳細情報を取得するには、以下のようにログレベルを一時的に debug に設定できます。

  1. /usr/lib/systemd/system/crio.service ファイルを編集し、以下のように --loglevel=debug を ExecStart= 行に追加します。

    ExecStart=/usr/bin/crio --log-level=debug \
              $CRIO_STORAGE_OPTIONS \
              $CRIO_NETWORK_OPTIONS
  2. 以下のように設定ファイルを再読み込みし、サービスを再起動します。

    # systemctl daemon-reload
    # systemctl restart crio
  3. journalctl コマンドを再度実行します。CRI-O サービスで進行中の処理を表す多くのデバッグメッセージが表示されるようになります。

    # journalctl -u crio
    Oct 18 08:41:31 mynode01-crio crio[21998]:
       time="2018-10-18 08:41:31.839702058-04:00" level=debug
       msg="ListContainersRequest &ListContainersRequest{Filter:&ContainerFilter{Id:,State:nil,PodSandboxId:
       ,LabelSelector:map[string]string{},},}"
    Oct 18 08:41:31 mynode01-crio crio[21998]: time="2018-10-18
       08:41:31.839928476-04:00" level=debug msg="no filters were applied,
       returning full container list"
    Oct 18 08:41:31 mynode01-crio crio[21998]: time="2018-10-18 08:41:31.841814536-04:00"
       level=debug msg="ListContainersResponse: &ListContainersResponse{Containers:
       [&Container{Id:e1934cc46696ff821bc35154f281764e80ac1122563ffd95aa92d01477225603,
       PodSandboxId:d904d45e6e46110a044758f20047805d8832b6859e10dc903c104cf757894e8d,
       Metadata:&ContainerMetadata{Name:c,Attempt:0,},Image:&ImageSpec{
       Image:e72de76ca8d5410497ae3171b6b059e7c7d11e4d1f3225df8d05812f29e205b7,},
       ImageRef:docker.io/openshift/origin-template-service-broker@sha256:fd539 ...
  4. 調査が完了したら --loglevel=debug オプションを削除し、生成されるメッセージの量を減らします。次に、2 つの systemctl コマンドを再度実行します。

    # systemctl daemon-reload
    # systemctl restart crio