Recopilación de registros y métricas

Pasos para recopilar registros y métricas para la catalogación de datos IBM.

Procedimiento

  1. Ejecute el siguiente mandato de inicio de sesión de oc .
    oc login --token=<OCP_TOKEN> --server=<OCP_SERVER>

    Para obtener más información sobre el inicio de sesión de CLI, consulte Inicio de sesión de CLI.

  2. Exportar variables de entorno OCP_TOKEN, PROJECT_NAMEy TIMESTAMP .
    export OCP_TOKEN=$(oc whoami --show-token) # or the actual token if not logged in
    export PROJECT_NAME=ibm-data-cataloging
    export TIMESTAMP=$(date +"%Y%m%d%H%M%S")
  3. Ejecute el mandato siguiente para crear un secreto con una señal para utilizarla en el script que recopila recursos.
    oc -n $PROJECT_NAME create secret generic dcs-must-gather --from-literal=token=$OCP_TOKEN
  4. Crear archivo dcs-must-gather-pod.yaml .
    cat >> dcs-must-gather-pod.yaml << EOF
    
    apiVersion: v1
    kind: Pod
    metadata:
      name: dcs-must-gather
      labels:
        app: isd
        component: discover
        role: must-gather
    spec:
      containers:
      - name: must-gather
        env:
          - name: WORKDIR
            value: /tmp
          - name: OCP_TOKEN
            valueFrom:
              secretKeyRef:
                name: dcs-must-gather
                key: token
        image: cp.icr.io/cp/ibm-spectrum-discover/must-gather:2.1.3
        imagePullPolicy: Always
        resources:
          requests:
            cpu: 50m
            memory: 128Mi
            ephemeral-storage: 2Gi
          limits:
            cpu: 2
            memory: 8Gi
            ephemeral-storage: 5Gi
        command:
          - '/bin/bash'
          - '-c'
          - '/opt/must-gather/must-gather.sh; while true; do sleep 60; done'
    
    EOF
    
  5. Ejecute el mandato siguiente para crear un pod must gather.
    oc -n $PROJECT_NAME create -f dcs-must-gather-pod.yaml
    
  6. Supervise los registros hasta que informe de que se ha creado el archivo tar .
    oc -n $PROJECT_NAME logs -f dcs-must-gather
    Ejemplo de salida:
    2023-09-12 04:12:12 - INFO - Archiving completed: dcs-must-gather.tar.xz
  7. Copie el archivo tar .
    oc -n $PROJECT_NAME cp dcs-must-gather:/tmp/dcs-must-gather.tar.xz dcs-must-gather-$TIMESTAMP.tar.xz
    
  8. Eliminar los recursos de must gather.
    oc -n $PROJECT_NAME delete pod dcs-must-gather
    oc -n $PROJECT_NAME delete secret dcs-must-gather