19.8. PTP 하드웨어 빠른 이벤트 알림 프레임워크

vRAN(가상 RAN)과 같은 클라우드 네이티브 애플리케이션에서는 전체 네트워크의 기능에 중요한 하드웨어 타이밍 이벤트에 대한 알림에 액세스해야 합니다. PTP 클럭 동기화 오류는 대기 시간이 짧은 애플리케이션의 성능과 안정성에 부정적인 영향을 미칠 수 있습니다(예: 분산 장치(DU)에서 실행되는 vRAN 애플리케이션).

19.8.1. PTP 및 클럭 동기화 오류 이벤트 정보

PTP 동기화 손실은 RAN 네트워크에 심각한 오류입니다. 노드에서 동기화가 손실된 경우 라디오가 종료될 수 있으며 네트워크 Over the Air (OTA) 트래픽이 무선 네트워크의 다른 노드로 이동될 수 있습니다. 클러스터 노드에서 PTP 클럭 동기화 상태를 DU에서 실행 중인 vRAN 애플리케이션에 통신할 수 있도록 함으로써 이벤트 알림이 워크로드 오류와 비교하여 완화됩니다.

이벤트 알림은 동일한 DU 노드에서 실행되는 vRAN 애플리케이션에서 사용할 수 있습니다. 게시-서브스크립션 REST API는 이벤트 알림을 메시징 버스에 전달합니다. 게시-서브스크립션 메시징 또는 published-sub 메시징은 모든 구독자가 해당 항목에 게시한 메시지를 즉시 수신하는 비동기 서비스 간 통신 아키텍처입니다.

PTP Operator는 모든 PTP 가능 네트워크 인터페이스에 대한 빠른 이벤트 알림을 생성합니다. HTTP 또는 AMQP(Advanced MessageECDHE Protocol) 메시지 버스를 통해 cloud-event-proxy 사이드카 컨테이너를 사용하여 이벤트에 액세스할 수 있습니다.

참고

PTP 빠른 이벤트 알림은 PTP 일반 클럭 또는 PTP 경계 클럭을 사용하도록 구성된 네트워크 인터페이스에 사용할 수 있습니다.

참고

가능한 경우 PTP 및 베어 메탈 이벤트에 AMQP 대신 HTTP 전송을 사용합니다. AMQ Interconnect는 2024년 6월 30일부터 EOL입니다. AMQ Interconnect의 ELS (Extended Life cycle Support)는 2029년 11월 29일에 종료됩니다. 자세한 내용은 Red Hat AMQ Interconnect 지원 상태를 참조하십시오.

19.8.2. PTP 빠른 이벤트 알림 프레임워크 정보

PTP(Precision Time Protocol) 빠른 이벤트 알림 프레임워크를 사용하여 베어 메탈 클러스터 노드가 생성하는 PTP 이벤트에 클러스터 애플리케이션을 등록합니다.

참고

빠른 이벤트 알림 프레임워크는 통신에 REST API를 사용합니다. REST API는 O-RAN ALLIANCE 사양에서 사용할 수 있는 이벤트 소비자 3.0에 대한 O-RAN O-Cloud 알림 API 사양 을 기반으로 합니다.

프레임워크는 게시자와 구독자 애플리케이션 간의 통신을 처리하는 게시자, 구독자 및 AMQ 또는 HTTP 메시징 프로토콜로 구성됩니다. 애플리케이션은 사이드카 패턴에서 cloud-event-proxy 컨테이너를 실행하여 PTP 이벤트를 구독합니다. cloud-event-proxy 사이드카 컨테이너는 기본 애플리케이션의 리소스를 사용하지 않고 대기 시간이 크게 발생하지 않고 기본 애플리케이션 컨테이너와 동일한 리소스에 액세스할 수 있습니다.

참고

가능한 경우 PTP 및 베어 메탈 이벤트에 AMQP 대신 HTTP 전송을 사용합니다. AMQ Interconnect는 2024년 6월 30일부터 EOL입니다. AMQ Interconnect의 ELS (Extended Life cycle Support)는 2029년 11월 29일에 종료됩니다. 자세한 내용은 Red Hat AMQ Interconnect 지원 상태를 참조하십시오.

그림 19.1. PTP 빠른 이벤트 개요

PTP 빠른 이벤트 개요
20 클러스터 호스트에서 이벤트가 생성됨
PTP Operator 관리 Pod의 linuxptp-daemon 은 Kubernetes DaemonSet 으로 실행되며 다양한 linuxptp 프로세스(ptp4l,phc2sys, 선택 옵션으로 할머 마스터 클럭, ts2phc)를 관리합니다. linuxptp-daemon 은 이벤트를 UNIX 도메인 소켓에 전달합니다.
20 이벤트가 cloud-event-proxy 사이드카에 전달됩니다.
PTP 플러그인은 UNIX 도메인 소켓에서 이벤트를 읽고 PTP Operator 관리 Pod의 cloud-event-proxy 사이드카로 전달합니다. Cloud-event-proxy 는 Kubernetes 인프라에서 대기 시간이 짧은 CNF(Cloud-Native Network Functions)로 이벤트를 제공합니다.
20 이벤트가 유지됨
PTP Operator 관리 Pod의 cloud-event-proxy 사이드카는 REST API를 사용하여 이벤트를 처리하고 클라우드 네이티브 이벤트를 게시합니다.
20 메시지가 전송됨
메시지 전송기는 HTTP 또는 AMQP 1.0 QPID를 통해 애플리케이션 Pod의 cloud-event-proxy 사이드카로 이벤트를 전송합니다.
20 REST API에서 이벤트 사용 가능
애플리케이션 Pod의 cloud-event-proxy 사이드카는 이벤트를 처리하고 REST API를 사용하여 이를 사용할 수 있도록 합니다.
20 소비자 애플리케이션은 서브스크립션을 요청하고 서브스크립션 이벤트를 수신합니다.
소비자 애플리케이션은 애플리케이션 Pod의 cloud-event-proxy 사이드카로 API 요청을 보내 PTP 이벤트 서브스크립션을 생성합니다. cloud-event-proxy 사이드카는 서브스크립션에 지정된 리소스에 대한 AMQ 또는 HTTP 메시징 리스너 프로토콜을 생성합니다.

애플리케이션 Pod의 cloud-event-proxy 사이드카는 PTP Operator 관리 Pod에서 이벤트를 수신하고, 클라우드 이벤트 오브젝트를 래핑하여 데이터를 검색하고 이벤트를 소비자 애플리케이션에 게시합니다. 소비자 애플리케이션은 리소스 한정자에 지정된 주소를 수신 대기하고 PTP 이벤트를 수신하고 처리합니다.

19.8.3. PTP 빠른 이벤트 알림 게시자 구성

클러스터에서 네트워크 인터페이스에 PTP 빠른 이벤트 알림을 사용하려면 PTP Operator PtpOperatorConfig CR(사용자 정의 리소스)에서 빠른 이벤트 게시자를 활성화하고 생성한 PtpConfig CR에서 ptpClockThreshold 값을 구성해야 합니다.

사전 요구 사항

  • OpenShift Container Platform CLI(oc)를 설치했습니다.
  • cluster-admin 권한이 있는 사용자로 로그인했습니다.
  • PTP Operator를 설치했습니다.

절차

  1. PTP 빠른 이벤트를 활성화하려면 기본 PTP Operator 구성을 수정합니다.

    1. 다음 YAML을 ptp-operatorconfig.yaml 파일에 저장합니다.

      apiVersion: ptp.openshift.io/v1
      kind: PtpOperatorConfig
      metadata:
        name: default
        namespace: openshift-ptp
      spec:
        daemonNodeSelector:
          node-role.kubernetes.io/worker: ""
        ptpEventConfig:
          enableEventPublisher: true 1
      1
      enableEventPublishertrue로 설정하여 PTP 빠른 이벤트 알림을 활성화합니다.
    참고

    OpenShift Container Platform 4.13 이상에서는 PTP 이벤트에 HTTP 전송을 사용할 때 PtpOperatorConfig.transportHost 리소스에서 spec.ptpEventConfig.transportHost 필드를 설정할 필요가 없습니다. PTP 이벤트에 AMQP 전송을 사용하는 경우에만 transportHost 를 설정합니다.

    1. PtpOperatorConfig CR을 업데이트합니다.

      $ oc apply -f ptp-operatorconfig.yaml
  2. PTP 지원 인터페이스에 대한 PtpConfig CR(사용자 정의 리소스)을 생성하고 ptpClockThresholdptp4lOpts 에 필요한 값을 설정합니다. 다음 YAML은 PtpConfig CR에 설정해야 하는 필수 값을 보여줍니다.

    spec:
      profile:
      - name: "profile1"
        interface: "enp5s0f0"
        ptp4lOpts: "-2 -s --summary_interval -4" 1
        phc2sysOpts: "-a -r -m -n 24 -N 8 -R 16" 2
        ptp4lConf: "" 3
      ptpClockThreshold: 4
        holdOverTimeout: 5
        maxOffsetThreshold: 100
        minOffsetThreshold: -100
    1
    PTP 빠른 이벤트를 사용하려면 --summary_interval -4 를 추가합니다.
    2
    필수 phc2sysOpts 값. -m 에서 stdout 에 메시지를 출력합니다. linuxptp-daemon DaemonSet 은 로그를 구문 분석하고 Prometheus 지표를 생성합니다.
    3
    기본 /etc/ptp4l.conf 파일을 대체할 구성이 포함된 문자열을 지정합니다. 기본 구성을 사용하려면 필드를 비워 둡니다.
    4
    선택 사항: ptpClockThreshold 가 없으면 기본값이 ptpClockThreshold 필드에 사용됩니다. 스탠자는 기본 ptpClockThreshold 값을 표시합니다. ptpClockThreshold 값은 PTP 이벤트가 트리거되기 전에 PTP 마스터 클럭이 연결 해제된 후의 기간을 구성합니다. holdOverTimeout 은 PTP 마스터 클럭의 연결이 끊어지면 PTP 클럭 이벤트 상태가 FREERUN 로 변경되기 전 시간(초)입니다. maxOffsetThresholdminOffsetThreshold 설정은 CLOCK_REALTIME (phc2sys) 또는 마스터 오프셋(ptp4l)의 값과 비교되는 나노초에 오프셋 값을 구성합니다. ptp4l 또는 phc2sys 오프셋 값이 이 범위를 벗어나는 경우 PTP 클럭 상태가 FREERUN 로 설정됩니다. 오프셋 값이 이 범위 내에 있으면 PTP 클럭 상태가 LOCKED 로 설정됩니다.

추가 리소스

19.8.4. PTP 또는 베어 메탈 이벤트에 대해 HTTP 전송을 사용하도록 소비자 애플리케이션 마이그레이션

이전에 PTP 또는 베어 메탈 이벤트 소비자 애플리케이션을 배포한 경우 HTTP 메시지 전송을 사용하도록 애플리케이션을 업데이트해야 합니다.

사전 요구 사항

  • OpenShift CLI(oc)가 설치되어 있습니다.
  • cluster-admin 권한이 있는 사용자로 로그인했습니다.
  • 기본적으로 HTTP 전송을 사용하는 PTP Operator 또는 Bare Metal Event Relay를 버전 4.13 이상으로 업데이트했습니다.

절차

  1. HTTP 전송을 사용하도록 이벤트 소비자 애플리케이션을 업데이트합니다. 클라우드 이벤트 사이드카 배포에 http-event-publishers 변수를 설정합니다.

    예를 들어 PTP 이벤트가 구성된 클러스터에서 다음 YAML 스니펫은 클라우드 이벤트 사이드카 배포를 보여줍니다.

    containers:
      - name: cloud-event-sidecar
        image: cloud-event-sidecar
        args:
          - "--metrics-addr=127.0.0.1:9091"
          - "--store-path=/store"
          - "--transport-host=consumer-events-subscription-service.cloud-events.svc.cluster.local:9043"
          - "--http-event-publishers=ptp-event-publisher-service-NODE_NAME.openshift-ptp.svc.cluster.local:9043" 1
          - "--api-port=8089"
    1
    PTP Operator는 NODE_NAME 을 PTP 이벤트를 생성하는 호스트로 자동으로 확인합니다. 예: compute-1.example.com.

    베어 메탈 이벤트가 구성된 클러스터에서는 클라우드 이벤트 사이드카 배포 CR에서 http-event-publishers 필드를 hw-event-publisher-service.openshift-bare-metal-events.svc.cluster.local:9043 으로 설정합니다.

  2. 이벤트 소비자 애플리케이션과 함께 consumer-events-subscription-service 서비스를 배포합니다. 예를 들면 다음과 같습니다.

    apiVersion: v1
    kind: Service
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        service.alpha.openshift.io/serving-cert-secret-name: sidecar-consumer-secret
      name: consumer-events-subscription-service
      namespace: cloud-events
      labels:
        app: consumer-service
    spec:
      ports:
        - name: sub-port
          port: 9043
      selector:
        app: consumer
      clusterIP: None
      sessionAffinity: None
      type: ClusterIP

19.8.5. AMQ 메시징 버스 설치

노드에서 게시자와 구독자 간에 PTP 빠른 이벤트 알림을 전달하려면 노드에서 로컬로 실행되도록 AMQ 메시징 버스를 설치하고 구성할 수 있습니다. AMQ 메시징을 사용하려면 AMQ Interconnect Operator를 설치해야 합니다.

참고

가능한 경우 PTP 및 베어 메탈 이벤트에 AMQP 대신 HTTP 전송을 사용합니다. AMQ Interconnect는 2024년 6월 30일부터 EOL입니다. AMQ Interconnect의 ELS (Extended Life cycle Support)는 2029년 11월 29일에 종료됩니다. 자세한 내용은 Red Hat AMQ Interconnect 지원 상태를 참조하십시오.

사전 요구 사항

  • OpenShift Container Platform CLI (oc)를 설치합니다.
  • cluster-admin 권한이 있는 사용자로 로그인합니다.

절차

검증

  1. AMQ Interconnect Operator를 사용할 수 있고 필요한 Pod가 실행 중인지 확인합니다.

    $ oc get pods -n amq-interconnect

    출력 예

    NAME                                    READY   STATUS    RESTARTS   AGE
    amq-interconnect-645db76c76-k8ghs       1/1     Running   0          23h
    interconnect-operator-5cb5fc7cc-4v7qm   1/1     Running   0          23h

  2. 필수 linuxptp-daemon PTP 이벤트 생산자 Pod가 openshift-ptp 네임스페이스에서 실행되고 있는지 확인합니다.

    $ oc get pods -n openshift-ptp

    출력 예

    NAME                     READY   STATUS    RESTARTS       AGE
    linuxptp-daemon-2t78p    3/3     Running   0              12h
    linuxptp-daemon-k8n88    3/3     Running   0              12h

19.8.6. PTP 이벤트 REST API 참조에 DU 애플리케이션 구독

PTP 이벤트 알림 REST API를 사용하여 상위 노드에서 생성된 PTP 이벤트에 분산 단위(DU) 애플리케이션을 구독합니다.

리소스 주소 /cluster/node/<node_name>/ptp 를 사용하여 PTP 이벤트에 애플리케이션을 서브스크립션합니다. 여기서 < node_name >은 DU 애플리케이션을 실행하는 클러스터 노드입니다.

별도의 DU 애플리케이션 Pod에 cloud-event-consumer DU 애플리케이션 컨테이너 및 cloud-event-proxy 사이드카 컨테이너를 배포합니다. cloud-event-consumer DU 애플리케이션은 애플리케이션 Pod의 cloud-event-proxy 컨테이너를 서브스크립션합니다.

다음 API 끝점을 사용하여 DU 애플리케이션 Pod의 http://localhost:8089/api/ocloudNotifications/v1/ 에서 cloud-event- consumer DU 애플리케이션을 게시한 PTP 이벤트에 등록합니다.

  • /api/ocloudNotifications/v1/subscriptions

    • POST: 새 서브스크립션을 생성합니다.
    • GET: 서브스크립션 목록 검색합니다.
  • /api/ocloudNotifications/v1/subscriptions/<subscription_id>

    • GET: 지정된 서브스크립션 ID에 대한 세부 정보를 반환합니다.
  • api/ocloudNotifications/v1/subscriptions/status/<subscription_id>

    • PUT: 지정된 서브스크립션 ID에 대한 새로운 상태 ping 요청을 생성
  • /api/ocloudNotifications/v1/health

    • GET: ocloudNotifications API의 상태를 반환합니다.
  • api/ocloudNotifications/v1/publishers

    • GET: 클러스터 노드에 대한 os-clock-sync-state,ptp-clock-class-changelock-state 메시지 배열을 반환합니다.
  • /api/ocloudnotifications/v1/<resource_address>/CurrentState

    • GET: os-clock-sync-state,ptp-clock-class-change, lock-state 이벤트 등 하나의 현재 상태를 반환합니다.
참고

9089 는 애플리케이션 Pod에 배포된 cloud-event-consumer 컨테이너의 기본 포트입니다. 필요에 따라 DU 애플리케이션의 다른 포트를 구성할 수 있습니다.

19.8.6.1. api/ocloudNotifications/v1/subscriptions

HTTP 방법

GET api/ocloudNotifications/v1/subscriptions

설명

서브스크립션 목록을 반환합니다. 서브스크립션이 존재하는 경우 200 OK 상태 코드가 서브스크립션 목록과 함께 반환됩니다.

API 응답 예

[
 {
  "id": "75b1ad8f-c807-4c23-acf5-56f4b7ee3826",
  "endpointUri": "http://localhost:9089/event",
  "uriLocation": "http://localhost:8089/api/ocloudNotifications/v1/subscriptions/75b1ad8f-c807-4c23-acf5-56f4b7ee3826",
  "resource": "/cluster/node/compute-1.example.com/ptp"
 }
]

HTTP 방법

POST api/ocloudNotifications/v1/subscriptions

설명

새 서브스크립션을 생성합니다. 서브스크립션이 성공적으로 생성되었거나 이미 존재하는 경우 201 Created 상태 코드가 반환됩니다.

표 19.5. 쿼리 매개변수

매개변수유형

subscription

data

페이로드 예

{
  "uriLocation": "http://localhost:8089/api/ocloudNotifications/v1/subscriptions",
  "resource": "/cluster/node/compute-1.example.com/ptp"
}

19.8.6.2. api/ocloudNotifications/v1/subscriptions/<subscription_id>

HTTP 방법

GET api/ocloudNotifications/v1/subscriptions/<subscription_id>

설명

ID <subscription _id>를 사용한 서브스크립션에 대한 세부 정보를 반환합니다.

표 19.6. 쿼리 매개변수

매개변수유형

<subscription_id>

string

API 응답 예

{
  "id":"48210fb3-45be-4ce0-aa9b-41a0e58730ab",
  "endpointUri": "http://localhost:9089/event",
  "uriLocation":"http://localhost:8089/api/ocloudNotifications/v1/subscriptions/48210fb3-45be-4ce0-aa9b-41a0e58730ab",
  "resource":"/cluster/node/compute-1.example.com/ptp"
}

19.8.6.3. api/ocloudNotifications/v1/subscriptions/status/<subscription_id>

HTTP 방법

PUT api/ocloudNotifications/v1/subscriptions/status/<subscription_id>

설명

ID <subscription _id>를 사용하여 서브스크립션에 대한 새 상태 ping 요청을 생성합니다. 서브스크립션이 있는 경우 상태 요청이 성공하고 202 Accepted 상태 코드가 반환됩니다.

표 19.7. 쿼리 매개변수

매개변수유형

<subscription_id>

string

API 응답 예

{"status":"ping sent"}

19.8.6.4. api/ocloudNotifications/v1/health/

HTTP 방법

GET api/ocloudNotifications/v1/health/

설명

ocloudNotifications REST API의 상태를 반환합니다.

API 응답 예

OK

19.8.6.5. api/ocloudNotifications/v1/publishers

HTTP 방법

GET api/ocloudNotifications/v1/publishers

설명

os-clock-sync-state,ptp-clock-class-change, and lock-state details for the cluster node를 반환합니다. 시스템은 관련 장비 상태가 변경될 때 알림을 생성합니다.

  • OS -clock-sync-state notifications는 호스트 운영 체제 클럭 동기화 상태를 설명합니다. LOCKED 또는 Free RUN 상태에 있을 수 있습니다.
  • PTP-clock-class-change notifications는 PTP 클럭 클래스의 현재 상태를 설명합니다.
  • lock-state notifications는 PTP 장비 잠금 상태의 현재 상태를 설명합니다. LOCKED,HOLDOVER 또는 FREERUN 상태에 있을 수 있습니다.

API 응답 예

[
  {
    "id": "0fa415ae-a3cf-4299-876a-589438bacf75",
    "endpointUri": "http://localhost:9085/api/ocloudNotifications/v1/dummy",
    "uriLocation": "http://localhost:9085/api/ocloudNotifications/v1/publishers/0fa415ae-a3cf-4299-876a-589438bacf75",
    "resource": "/cluster/node/compute-1.example.com/sync/sync-status/os-clock-sync-state"
  },
  {
    "id": "28cd82df-8436-4f50-bbd9-7a9742828a71",
    "endpointUri": "http://localhost:9085/api/ocloudNotifications/v1/dummy",
    "uriLocation": "http://localhost:9085/api/ocloudNotifications/v1/publishers/28cd82df-8436-4f50-bbd9-7a9742828a71",
    "resource": "/cluster/node/compute-1.example.com/sync/ptp-status/ptp-clock-class-change"
  },
  {
    "id": "44aa480d-7347-48b0-a5b0-e0af01fa9677",
    "endpointUri": "http://localhost:9085/api/ocloudNotifications/v1/dummy",
    "uriLocation": "http://localhost:9085/api/ocloudNotifications/v1/publishers/44aa480d-7347-48b0-a5b0-e0af01fa9677",
    "resource": "/cluster/node/compute-1.example.com/sync/ptp-status/lock-state"
  }
]

cloud-event-proxy 컨테이너의 로그에서 os-clock-sync-state,ptp-clock-class-changelock-state 이벤트를 찾을 수 있습니다. 예를 들면 다음과 같습니다.

$ oc logs -f linuxptp-daemon-cvgr6 -n openshift-ptp -c cloud-event-proxy

os-clock-sync-state 이벤트 예

{
   "id":"c8a784d1-5f4a-4c16-9a81-a3b4313affe5",
   "type":"event.sync.sync-status.os-clock-sync-state-change",
   "source":"/cluster/compute-1.example.com/ptp/CLOCK_REALTIME",
   "dataContentType":"application/json",
   "time":"2022-05-06T15:31:23.906277159Z",
   "data":{
      "version":"v1",
      "values":[
         {
            "resource":"/sync/sync-status/os-clock-sync-state",
            "dataType":"notification",
            "valueType":"enumeration",
            "value":"LOCKED"
         },
         {
            "resource":"/sync/sync-status/os-clock-sync-state",
            "dataType":"metric",
            "valueType":"decimal64.3",
            "value":"-53"
         }
      ]
   }
}

ptp-clock-class-change 이벤트 예

{
   "id":"69eddb52-1650-4e56-b325-86d44688d02b",
   "type":"event.sync.ptp-status.ptp-clock-class-change",
   "source":"/cluster/compute-1.example.com/ptp/ens2fx/master",
   "dataContentType":"application/json",
   "time":"2022-05-06T15:31:23.147100033Z",
   "data":{
      "version":"v1",
      "values":[
         {
            "resource":"/sync/ptp-status/ptp-clock-class-change",
            "dataType":"metric",
            "valueType":"decimal64.3",
            "value":"135"
         }
      ]
   }
}

lock-state 이벤트 예

{
   "id":"305ec18b-1472-47b3-aadd-8f37933249a9",
   "type":"event.sync.ptp-status.ptp-state-change",
   "source":"/cluster/compute-1.example.com/ptp/ens2fx/master",
   "dataContentType":"application/json",
   "time":"2022-05-06T15:31:23.467684081Z",
   "data":{
      "version":"v1",
      "values":[
         {
            "resource":"/sync/ptp-status/lock-state",
            "dataType":"notification",
            "valueType":"enumeration",
            "value":"LOCKED"
         },
         {
            "resource":"/sync/ptp-status/lock-state",
            "dataType":"metric",
            "valueType":"decimal64.3",
            "value":"62"
         }
      ]
   }
}

19.8.6.6. /api/ocloudnotifications/v1/<resource_address>/CurrentState

HTTP 방법

GET api/ocloudNotifications/v1/cluster/node/<node_name>/sync/ptp-status/lock-state/CurrentState

GET api/ocloudNotifications/v1/cluster/node/<node_name>/sync/sync-status/os-clock-sync-state/CurrentState

GET api/ocloudNotifications/v1/cluster/node/<node_name>/sync/ptp-status/ptp-clock-class-change/CurrentState

설명

클러스터 노드의 os-clock-sync-state,ptp-clock-class-change, lock-state 이벤트의 현재 상태를 반환하도록 CurrentState API 엔드포인트를 구성합니다.

  • OS -clock-sync-state notifications는 호스트 운영 체제 클럭 동기화 상태를 설명합니다. LOCKED 또는 Free RUN 상태에 있을 수 있습니다.
  • PTP-clock-class-change notifications는 PTP 클럭 클래스의 현재 상태를 설명합니다.
  • lock-state notifications는 PTP 장비 잠금 상태의 현재 상태를 설명합니다. LOCKED,HOLDOVER 또는 FREERUN 상태에 있을 수 있습니다.

표 19.8. 쿼리 매개변수

매개변수유형

<resource_address>

string

lock-state API 응답 예

{
  "id": "c1ac3aa5-1195-4786-84f8-da0ea4462921",
  "type": "event.sync.ptp-status.ptp-state-change",
  "source": "/cluster/node/compute-1.example.com/sync/ptp-status/lock-state",
  "dataContentType": "application/json",
  "time": "2023-01-10T02:41:57.094981478Z",
  "data": {
    "version": "v1",
    "values": [
      {
        "resource": "/cluster/node/compute-1.example.com/ens5fx/master",
        "dataType": "notification",
        "valueType": "enumeration",
        "value": "LOCKED"
      },
      {
        "resource": "/cluster/node/compute-1.example.com/ens5fx/master",
        "dataType": "metric",
        "valueType": "decimal64.3",
        "value": "29"
      }
    ]
  }
}

os-clock-sync-state API 응답 예

{
  "specversion": "0.3",
  "id": "4f51fe99-feaa-4e66-9112-66c5c9b9afcb",
  "source": "/cluster/node/compute-1.example.com/sync/sync-status/os-clock-sync-state",
  "type": "event.sync.sync-status.os-clock-sync-state-change",
  "subject": "/cluster/node/compute-1.example.com/sync/sync-status/os-clock-sync-state",
  "datacontenttype": "application/json",
  "time": "2022-11-29T17:44:22.202Z",
  "data": {
    "version": "v1",
    "values": [
      {
        "resource": "/cluster/node/compute-1.example.com/CLOCK_REALTIME",
        "dataType": "notification",
        "valueType": "enumeration",
        "value": "LOCKED"
      },
      {
        "resource": "/cluster/node/compute-1.example.com/CLOCK_REALTIME",
        "dataType": "metric",
        "valueType": "decimal64.3",
        "value": "27"
      }
    ]
  }
}

ptp-clock-class-change API 응답 예

{
  "id": "064c9e67-5ad4-4afb-98ff-189c6aa9c205",
  "type": "event.sync.ptp-status.ptp-clock-class-change",
  "source": "/cluster/node/compute-1.example.com/sync/ptp-status/ptp-clock-class-change",
  "dataContentType": "application/json",
  "time": "2023-01-10T02:41:56.785673989Z",
  "data": {
    "version": "v1",
    "values": [
      {
        "resource": "/cluster/node/compute-1.example.com/ens5fx/master",
        "dataType": "metric",
        "valueType": "decimal64.3",
        "value": "165"
      }
    ]
  }
}

19.8.7. PTP 빠른 이벤트 메트릭 모니터링

linuxptp-daemon 이 실행중인 클러스터 노드에서 PTP 빠른 이벤트 메트릭을 모니터링할 수 있습니다. 사전 구성 및 자체 업데이트 Prometheus 모니터링 스택을 사용하여 OpenShift Container Platform 웹 콘솔에서 PTP 빠른 이벤트 메트릭을 모니터링할 수도 있습니다.

사전 요구 사항

  • OpenShift Container Platform CLI oc를 설치합니다.
  • cluster-admin 권한이 있는 사용자로 로그인합니다.
  • PTP 가능 하드웨어를 사용하여 노드에 PTP Operator를 설치하고 구성합니다.

절차

  1. linuxptp-daemon 이 실행 중인 모든 노드에서 노출된 PTP 지표를 확인합니다. 예를 들어 다음 명령을 실행합니다.

    $ curl http://<node_name>:9091/metrics

    출력 예

    # HELP openshift_ptp_clock_state 0 = FREERUN, 1 = LOCKED, 2 = HOLDOVER
    # TYPE openshift_ptp_clock_state gauge
    openshift_ptp_clock_state{iface="ens1fx",node="compute-1.example.com",process="ptp4l"} 1
    openshift_ptp_clock_state{iface="ens3fx",node="compute-1.example.com",process="ptp4l"} 1
    openshift_ptp_clock_state{iface="ens5fx",node="compute-1.example.com",process="ptp4l"} 1
    openshift_ptp_clock_state{iface="ens7fx",node="compute-1.example.com",process="ptp4l"} 1
    # HELP openshift_ptp_delay_ns
    # TYPE openshift_ptp_delay_ns gauge
    openshift_ptp_delay_ns{from="master",iface="ens1fx",node="compute-1.example.com",process="ptp4l"} 842
    openshift_ptp_delay_ns{from="master",iface="ens3fx",node="compute-1.example.com",process="ptp4l"} 480
    openshift_ptp_delay_ns{from="master",iface="ens5fx",node="compute-1.example.com",process="ptp4l"} 584
    openshift_ptp_delay_ns{from="master",iface="ens7fx",node="compute-1.example.com",process="ptp4l"} 482
    openshift_ptp_delay_ns{from="phc",iface="CLOCK_REALTIME",node="compute-1.example.com",process="phc2sys"} 547
    # HELP openshift_ptp_offset_ns
    # TYPE openshift_ptp_offset_ns gauge
    openshift_ptp_offset_ns{from="master",iface="ens1fx",node="compute-1.example.com",process="ptp4l"} -2
    openshift_ptp_offset_ns{from="master",iface="ens3fx",node="compute-1.example.com",process="ptp4l"} -44
    openshift_ptp_offset_ns{from="master",iface="ens5fx",node="compute-1.example.com",process="ptp4l"} -8
    openshift_ptp_offset_ns{from="master",iface="ens7fx",node="compute-1.example.com",process="ptp4l"} 3
    openshift_ptp_offset_ns{from="phc",iface="CLOCK_REALTIME",node="compute-1.example.com",process="phc2sys"} 12

  2. OpenShift Container Platform 웹 콘솔에서 PTP 이벤트를 보려면 쿼리할 PTP 메트릭의 이름을 복사합니다(예: openshift_ptp_offset_ns ).
  3. OpenShift Container Platform 웹 콘솔에서 모니터링메트릭을 클릭합니다.
  4. PTP 메트릭 이름을 표현식 필드에 붙여넣고 쿼리 실행을 클릭합니다.

추가 리소스