26.3. Kafka 재시작 확인
oc 명령을 사용하여 Cluster Operator에서 시작한 재시작 이벤트를 나열합니다. reportingController 또는 소스 이벤트 필드를 사용하여 Cluster Operator를 보고 구성 요소로 설정하여 Cluster Operator에서 내보내는 재시작 이벤트를 필터링합니다.
사전 요구 사항
- Cluster Operator가 OpenShift 클러스터에서 실행 중입니다.
절차
Cluster Operator가 내보내는 모든 재시작 이벤트를 가져옵니다.
oc -n kafka get events --field-selector reportingController=strimzi.io/cluster-operator반환된 이벤트 표시 예
LAST SEEN TYPE REASON OBJECT MESSAGE 2m Normal CaCertRenewed pod/strimzi-cluster-kafka-0 CA certificate renewed 58m Normal PodForceRestartOnError pod/strimzi-cluster-kafka-1 Pod needs to be forcibly restarted due to an error 5m47s Normal ManualRollingUpdate pod/strimzi-cluster-kafka-2 Pod was manually annotated to be rolled반환된 이벤트를 제한하기 위해
이유또는 기타필드 선택기옵션을 지정할 수도 있습니다.여기에는 구체적인 이유가 추가되었습니다.
oc -n kafka get events --field-selector reportingController=strimzi.io/cluster-operator,reason=PodForceRestartOnErrorYAML과 같은 출력 형식을 사용하여 하나 이상의 이벤트에 대한 자세한 정보를 반환합니다.
oc -n kafka get events --field-selector reportingController=strimzi.io/cluster-operator,reason=PodForceRestartOnError -o yaml자세한 이벤트 출력 예
apiVersion: v1 items: - action: StrimziInitiatedPodRestart apiVersion: v1 eventTime: "2022-05-13T00:22:34.168086Z" firstTimestamp: null involvedObject: kind: Pod name: strimzi-cluster-kafka-1 namespace: kafka kind: Event lastTimestamp: null message: Pod needs to be forcibly restarted due to an error metadata: creationTimestamp: "2022-05-13T00:22:34Z" generateName: strimzi-event name: strimzi-eventwppk6 namespace: kafka resourceVersion: "432961" uid: 29fcdb9e-f2cf-4c95-a165-a5efcd48edfc reason: PodForceRestartOnError reportingController: strimzi.io/cluster-operator reportingInstance: strimzi-cluster-operator-6458cfb4c6-6bpdp source: {} type: Normal kind: List metadata: resourceVersion: "" selfLink: ""
다음 필드는 더 이상 사용되지 않으므로 이러한 이벤트에는 채워지지 않습니다.
-
firstTimestamp -
lastTimestamp -
source