Host günlüklerini görüntülemek

"oc get nodes" komutu hostların listesini döndürecektir.

# oc get nodes
NAME                                  STATUS   ROLES                  AGE    VERSION
infra1.ocp-dev.devops.firmaismi.net    Ready    infra,worker           201d   v1.27.6+d548052
infra2.ocp-dev.devops.firmaismi.net    Ready    infra,worker           201d   v1.27.6+d548052
infra3.ocp-dev.devops.firmaismi.net    Ready    infra,worker           201d   v1.27.6+d548052
master1.ocp-dev.devops.firmaismi.net   Ready    control-plane,master   201d   v1.27.6+d548052
master2.ocp-dev.devops.firmaismi.net   Ready    control-plane,master   201d   v1.27.6+d548052
master3.ocp-dev.devops.firmaismi.net   Ready    control-plane,master   201d   v1.27.6+d548052
worker1.ocp-dev.devops.firmaismi.net   Ready    worker                 199d   v1.27.6+d548052
worker2.ocp-dev.devops.firmaismi.net   Ready    worker                 200d   v1.27.6+d548052
worker3.ocp-dev.devops.firmaismi.net   Ready    worker                 200d   v1.27.6+d548052

Daha sonra hostların günlüklerini görüntülemek için "oc adm node-logs" komutu kullanılabilir. Ana hostlarıdaki mevcut günlüklerin listesini almak için önce bu komutu kullanmalısınız.

oc adm node-logs --role master --path=/
master1.ocp-dev.devops.firmaismi.net README
master1.ocp-dev.devops.firmaismi.net audit/
master1.ocp-dev.devops.firmaismi.net btmp
master1.ocp-dev.devops.firmaismi.net btmp-20240601
master1.ocp-dev.devops.firmaismi.net chrony/
master1.ocp-dev.devops.firmaismi.net containers/
master1.ocp-dev.devops.firmaismi.net crio/
master1.ocp-dev.devops.firmaismi.net etcd/
master1.ocp-dev.devops.firmaismi.net glusterfs/
master1.ocp-dev.devops.firmaismi.net journal/
master1.ocp-dev.devops.firmaismi.net kube-apiserver/
master1.ocp-dev.devops.firmaismi.net lastlog
master1.ocp-dev.devops.firmaismi.net oauth-apiserver/
master1.ocp-dev.devops.firmaismi.net oauth-server/
master1.ocp-dev.devops.firmaismi.net openshift-apiserver/
master1.ocp-dev.devops.firmaismi.net openvswitch/
master1.ocp-dev.devops.firmaismi.net ovn/
master1.ocp-dev.devops.firmaismi.net pods/
master1.ocp-dev.devops.firmaismi.net private/
master1.ocp-dev.devops.firmaismi.net qemu-ga/
master1.ocp-dev.devops.firmaismi.net samba/
master1.ocp-dev.devops.firmaismi.net sssd/
master1.ocp-dev.devops.firmaismi.net tallylog
master1.ocp-dev.devops.firmaismi.net vmware-network.1.log
master1.ocp-dev.devops.firmaismi.net vmware-network.2.log
master1.ocp-dev.devops.firmaismi.net vmware-network.log
master1.ocp-dev.devops.firmaismi.net vmware-vgauthsvc.log.0
master1.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.1.log
master1.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.10.log
master1.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.2.log
master1.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.3.log
master1.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.4.log
master1.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.5.log
master1.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.6.log
master1.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.7.log
master1.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.8.log
master1.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.9.log
master1.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.log
master1.ocp-dev.devops.firmaismi.net vmware-vmtoolsd-root.log
master1.ocp-dev.devops.firmaismi.net wtmp
master2.ocp-dev.devops.firmaismi.net README
master2.ocp-dev.devops.firmaismi.net audit/
master2.ocp-dev.devops.firmaismi.net btmp
master2.ocp-dev.devops.firmaismi.net btmp-20240601
master2.ocp-dev.devops.firmaismi.net chrony/
master2.ocp-dev.devops.firmaismi.net containers/
master2.ocp-dev.devops.firmaismi.net crio/
master2.ocp-dev.devops.firmaismi.net etcd/
master2.ocp-dev.devops.firmaismi.net glusterfs/
master2.ocp-dev.devops.firmaismi.net journal/
master2.ocp-dev.devops.firmaismi.net kube-apiserver/
master2.ocp-dev.devops.firmaismi.net lastlog
master2.ocp-dev.devops.firmaismi.net oauth-apiserver/
master2.ocp-dev.devops.firmaismi.net oauth-server/
master2.ocp-dev.devops.firmaismi.net openshift-apiserver/
master2.ocp-dev.devops.firmaismi.net openvswitch/
master2.ocp-dev.devops.firmaismi.net ovn/
master2.ocp-dev.devops.firmaismi.net pods/
master2.ocp-dev.devops.firmaismi.net private/
master2.ocp-dev.devops.firmaismi.net qemu-ga/
master2.ocp-dev.devops.firmaismi.net samba/
master2.ocp-dev.devops.firmaismi.net sssd/
master2.ocp-dev.devops.firmaismi.net tallylog
master2.ocp-dev.devops.firmaismi.net vmware-network.1.log
master2.ocp-dev.devops.firmaismi.net vmware-network.2.log
master2.ocp-dev.devops.firmaismi.net vmware-network.log
master2.ocp-dev.devops.firmaismi.net vmware-vgauthsvc.log.0
master2.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.1.log
master2.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.10.log
master2.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.2.log
master2.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.3.log
master2.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.4.log
master2.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.5.log
master2.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.6.log
master2.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.7.log
master2.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.8.log
master2.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.9.log
master2.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.log
master2.ocp-dev.devops.firmaismi.net vmware-vmtoolsd-root.log
master2.ocp-dev.devops.firmaismi.net wtmp
master3.ocp-dev.devops.firmaismi.net README
master3.ocp-dev.devops.firmaismi.net audit/
master3.ocp-dev.devops.firmaismi.net btmp
master3.ocp-dev.devops.firmaismi.net btmp-20240601
master3.ocp-dev.devops.firmaismi.net chrony/
master3.ocp-dev.devops.firmaismi.net containers/
master3.ocp-dev.devops.firmaismi.net crio/
master3.ocp-dev.devops.firmaismi.net etcd/
master3.ocp-dev.devops.firmaismi.net glusterfs/
master3.ocp-dev.devops.firmaismi.net journal/
master3.ocp-dev.devops.firmaismi.net kube-apiserver/
master3.ocp-dev.devops.firmaismi.net lastlog
master3.ocp-dev.devops.firmaismi.net oauth-apiserver/
master3.ocp-dev.devops.firmaismi.net oauth-server/
master3.ocp-dev.devops.firmaismi.net openshift-apiserver/
master3.ocp-dev.devops.firmaismi.net openvswitch/
master3.ocp-dev.devops.firmaismi.net ovn/
master3.ocp-dev.devops.firmaismi.net ovn-kubernetes/
master3.ocp-dev.devops.firmaismi.net pods/
master3.ocp-dev.devops.firmaismi.net private/
master3.ocp-dev.devops.firmaismi.net qemu-ga/
master3.ocp-dev.devops.firmaismi.net samba/
master3.ocp-dev.devops.firmaismi.net sssd/
master3.ocp-dev.devops.firmaismi.net tallylog
master3.ocp-dev.devops.firmaismi.net vmware-network.1.log
master3.ocp-dev.devops.firmaismi.net vmware-network.2.log
master3.ocp-dev.devops.firmaismi.net vmware-network.log
master3.ocp-dev.devops.firmaismi.net vmware-vgauthsvc.log.0
master3.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.1.log
master3.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.10.log
master3.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.2.log
master3.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.3.log
master3.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.4.log
master3.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.5.log
master3.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.6.log
master3.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.7.log
master3.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.8.log
master3.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.9.log
master3.ocp-dev.devops.firmaismi.net vmware-vmsvc-root.log
master3.ocp-dev.devops.firmaismi.net vmware-vmtoolsd-root.log
master3.ocp-dev.devops.firmaismi.net wtmp

Örneğin, tüm ana hostlardan gelen tüm kubelet günlüklerini görüntülemek için.

oc adm node-logs --role master --unit kubelet

Bu üsteki sorgu genellikle stdout'un tüm bir günlüğünü uzun bir şekilde döndürecektir, bu nedenle her zaman ekrana gelen çıktıyı sınırladırmak için --tail eklemek isteyeceksiniz.

oc adm node-logs --role master --unit kubelet --tail=50

Sonuda birde grep ekleyip istediğiniz kelimeyi eklerseniz log araştırmada sizlere faydası olacaktır.

oc adm node-logs --role worker --unit kubelet --tail 50 --grep 'certificate has expired'

Last updated