11.2. Red Hat Quay 복원


이 절차는 Red Hat Quay Operator가 데이터베이스를 관리할 때 Red Hat Quay를 복원하는 데 사용됩니다. Red Hat Quay 레지스트리의 백업 후 수행해야 합니다. 자세한 내용은 Red Hat Quay 백업을 참조하십시오.

사전 요구 사항

  • Red Hat Quay는 Red Hat Quay Operator를 사용하여 OpenShift Container Platform에 배포됩니다.
  • Red Hat Quay Operator에서 관리하는 Red Hat Quay 구성의 백업은 Red Hat Quay 섹션의 지침에 따라 생성되었습니다.
  • Red Hat Quay 데이터베이스가 백업되었습니다.
  • Red Hat Quay에서 사용하는 오브젝트 스토리지 버킷이 백업되었습니다.
  • 구성 요소 quay,postgresobjectstoragemanaged: true로 설정됩니다.
  • 구성 요소 clairmanaged: true 로 설정된 경우 구성 요소 clairpostgresmanaged: true 로 설정됩니다(Red Hat Quay Operator v3.7 이상으로 시작)
  • OpenShift Container Platform 클러스터의 대상 네임스페이스에서 Red Hat Quay Operator에서 관리하는 실행 중인 Red Hat Quay 배포가 없습니다.
참고

배포에 부분적으로 관리되지 않는 데이터베이스 또는 스토리지 구성 요소가 포함되어 있고 Postgres 또는 S3 호환 오브젝트 스토리지에 외부 서비스를 사용하여 Red Hat Quay 배포를 실행하는 경우, Red Hat Quay를 복원하기 전에 백업에서 데이터를 복원하려면 서비스 공급자 또는 공급 업체 설명서를 참조해야 합니다.

11.2.1. Red Hat Quay 및 백업에서 구성 복원

참고

이 지침에서는 Red Hat Quay 백업 가이드의 프로세스를 따라 동일한 이름으로 백업 파일을 생성한다고 가정합니다.

  1. 백업된 Red Hat Quay 구성 및 백업에서 생성된 키를 복원합니다.

    $ oc create -f ./config-bundle.yaml
    
    $ oc create -f ./managed-secret-keys.yaml
    중요

    "./config-bundle.yaml": secrets "config-bundle-secret"을 생성할 때 오류 발생 (AlreadyExists): 오류가 발생하면 $ oc delete Secret config-bundle-secret -n <quay-namespace>를 사용하여 기존 리소스를 삭제하고 $ oc create -f./config-bundle.yaml.yaml로 다시 생성해야 합니다.

  2. QuayRegistry 사용자 정의 리소스를 복원합니다.

    $ oc create -f ./quay-registry.yaml
  3. Red Hat Quay 배포 상태를 확인하고 사용 가능할 때까지 기다립니다.

    $ oc wait quayregistry registry --for=condition=Available=true -n <quay-namespace>

11.2.2. Red Hat Quay 배포 축소

  1. Operator 버전 3.7 이상: 자동 스케일링을 비활성화하고 Quay, 미러 작업자 및 Clair(관리된 경우)의 복제본 수를 재정의하여 Red Hat Quay 배포를 축소합니다. QuayRegistry 리소스는 다음과 유사해야 합니다.

    apiVersion: quay.redhat.com/v1
    kind: QuayRegistry
    metadata:
      name: registry
      namespace: ns
    spec:
      components:- kind: horizontalpodautoscaler
          managed: false 
    1
    
        - kind: quay
          managed: true
          overrides: 
    2
    
            replicas: 0
        - kind: clair
          managed: true
          overrides:
            replicas: 0
        - kind: mirror
          managed: true
          overrides:
            replicas: 0
    1
    Quay, Clair 및 미러링 작업자의 자동 스케일링 비활성화
    2
    데이터베이스 및 objectstorage에 액세스하는 구성 요소의 경우 복제본 수를 0으로 설정합니다.
  2. Operator 버전 3.6 이하의 경우: Red Hat Quay Operator를 먼저 축소한 다음 관리되는 Red Hat Quay 리소스를 확장하여 Red Hat Quay 배포를 축소합니다.

    $ oc scale --replicas=0 deployment $(oc get deployment -n <quay-operator-namespace>|awk '/^quay-operator/ {print $1}') -n <quay-operator-namespace>
    
    $ oc scale --replicas=0 deployment $(oc get deployment -n <quay-namespace>|awk '/quay-app/ {print $1}') -n <quay-namespace>
    $ oc scale --replicas=0 deployment $(oc get deployment -n <quay-namespace>|awk '/quay-mirror/ {print $1}') -n <quay-namespace>
    $ oc scale --replicas=0 deployment $(oc get deployment -n <quay-namespace>|awk '/clair-app/ {print $1}') -n <quay-namespace>
  3. registry-quay-app,registry-quay-mirrorregistry-clair-app Pod(Operator에서 관리하도록 설정한 구성 요소에 따라)가 사라질 때까지 기다립니다. 다음 명령을 실행하여 상태를 확인할 수 있습니다.

    $ oc get pods -n <quay-namespace>

    출력 예:

    registry-quay-config-editor-77847fc4f5-nsbbv   1/1     Running            0          9m1s
    registry-quay-database-66969cd859-n2ssm        1/1     Running            0          6d1h
    registry-quay-redis-7cc5f6c977-956g8           1/1     Running            0          5d21h

11.2.3. Red Hat Quay 데이터베이스 복원

  1. Quay 데이터베이스 포드를 식별합니다.

    $ oc get pod -l quay-component=postgres -n  <quay-namespace> -o jsonpath='{.items[0].metadata.name}'

    출력 예:

    quayregistry-quay-database-59f54bb7-58xs7
  2. 로컬 환경 및 Pod에 백업을 복사하여 백업을 업로드합니다.

    $ oc cp ./backup.sql -n <quay-namespace> registry-quay-database-66969cd859-n2ssm:/tmp/backup.sql
  3. 데이터베이스에 대한 원격 터미널을 엽니다.

    $ oc rsh -n <quay-namespace> registry-quay-database-66969cd859-n2ssm
  4. psql을 입력합니다.

    bash-4.4$ psql
  5. 다음 명령을 실행하여 데이터베이스를 나열할 수 있습니다.

    postgres=# \l

    출력 예:

                                                      List of databases
               Name            |           Owner            | Encoding |  Collate   |   Ctype    |   Access privileges
    ----------------------------+----------------------------+----------+------------+------------+-----------------------
    postgres                   | postgres                   | UTF8     | en_US.utf8 | en_US.utf8 |
    quayregistry-quay-database | quayregistry-quay-database | UTF8     | en_US.utf8 | en_US.utf8 |
  6. 데이터베이스를 삭제합니다.

    postgres=# DROP DATABASE "quayregistry-quay-database";

    출력 예:

    DROP DATABASE
  7. postgres CLI를 종료하여 bash-4.4를 다시 입력합니다.

    \q
  8. PostgreSQL 데이터베이스를 백업 데이터베이스로 리디렉션합니다.

    sh-4.4$ psql < /tmp/backup.sql
  9. bash를 종료합니다.

    sh-4.4$ exit

11.2.4. Red Hat Quay 오브젝트 스토리지 데이터 복원

  1. AWS_ACCESS_KEY_ID 를 내보냅니다.

    $ export AWS_ACCESS_KEY_ID=$(oc get secret -l app=noobaa -n <quay-namespace>  -o jsonpath='{.items[0].data.AWS_ACCESS_KEY_ID}' |base64 -d)
  2. AWS_SECRET_ACCESS_KEY 내보내기:

    $ export AWS_SECRET_ACCESS_KEY=$(oc get secret -l app=noobaa -n <quay-namespace> -o jsonpath='{.items[0].data.AWS_SECRET_ACCESS_KEY}' |base64 -d)
  3. 다음 명령을 실행하여 모든 Blob을 버킷에 업로드합니다.

    $ aws s3 sync --no-verify-ssl --endpoint https://$(oc get route s3 -n openshift-storage  -o jsonpath='{.spec.host}') ./blobs  s3://$(oc get cm -l app=noobaa -n <quay-namespace> -o jsonpath='{.items[0].data.BUCKET_NAME}')
참고

AWS 명령줄 유틸리티 대신 rclone 또는 sc3md 를 사용할 수도 있습니다.

11.2.5. Red Hat Quay 배포 확장

  1. Operator 버전 3.7 이상: 필요에 따라 자동 스케일링을 재활성화하고 Quay, 미러 작업자 및 Clair에 대한 복제본 덮어쓰기를 제거하여 Red Hat Quay 배포를 확장합니다. QuayRegistry 리소스는 다음과 유사해야 합니다.

    apiVersion: quay.redhat.com/v1
    kind: QuayRegistry
    metadata:
      name: registry
      namespace: ns
    spec:
      components:- kind: horizontalpodautoscaler
          managed: true 
    1
    
        - kind: quay 
    2
    
          managed: true
        - kind: clair
          managed: true
        - kind: mirror
          managed: true
    1
    Red Hat Quay, Clair 및 미러링 작업자의 자동 스케일링을 다시 활성화(원하는 경우)
    2
    Red Hat Quay 구성 요소를 백업하기 위해 복제본 덮어쓰기가 다시 제거됨
  2. Operator 버전 3.6 이하의 경우: Red Hat Quay Operator를 다시 확장하여 Red Hat Quay 배포를 확장합니다.

    $ oc scale --replicas=1 deployment $(oc get deployment -n <quay-operator-namespace> | awk '/^quay-operator/ {print $1}') -n <quay-operator-namespace>
  3. Red Hat Quay 배포 상태를 확인합니다.

    $ oc wait quayregistry registry --for=condition=Available=true -n <quay-namespace>

    출력 예:

    apiVersion: quay.redhat.com/v1
    kind: QuayRegistry
    metadata:
      ...
      name: registry
      namespace: <quay-namespace>
      ...
    spec:
      ...
    status:
      - lastTransitionTime: '2022-06-20T05:31:17Z'
        lastUpdateTime: '2022-06-20T17:31:13Z'
        message: All components reporting as healthy
        reason: HealthChecksPassing
        status: 'True'
        type: Available
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동