InfoGrab Docs

단계별 가져오기

요약

오프라인 가비지 컬렉션을 정기적으로 실행하는 경우 단계별 가져오기 방법을 사용하십시오. 가져오기 중에 레지스트리를 종료하거나 read-only 모드를 유지해야 합니다. /etc/gitlab/gitlab.rb 파일의 registry['database'] 섹션에서 데이터베이스가 비활성화되어 있는지 확인합니다:

오프라인 가비지 컬렉션을 정기적으로 실행하는 경우 단계별 가져오기 방법을 사용하십시오. 이 방법은 3단계 가져오기 방법에 비해 더 간단한 작업입니다.

단계별 가져오기#

Warning

가져오기 중에 레지스트리를 종료하거나 read-only 모드를 유지해야 합니다. 그렇지 않으면 가져오기 중에 작성된 데이터에 액세스할 수 없거나 일관성 문제가 발생합니다.

  1. /etc/gitlab/gitlab.rb 파일의 registry['database'] 섹션에서 데이터베이스가 비활성화되어 있는지 확인합니다:

    registry['database'] = {
      'enabled' => false, # Must be false!
    }
    
  2. 레지스트리가 read-only 모드로 설정되어 있는지 확인합니다.

    /etc/gitlab/gitlab.rb를 편집하고 registry['storage'] 구성에 maintenance 섹션을 추가합니다. 예를 들어, gs://my-company-container-registry 버킷을 사용하는 gcs 백엔드 레지스트리의 경우 구성은 다음과 같을 수 있습니다:

    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => true # Must be set to true.
        }
      }
    }
    
  3. 파일을 저장하고 GitLab을 재구성합니다.

  4. 데이터베이스 마이그레이션을 적용합니다.

  5. 다음 명령을 실행합니다:

    sudo gitlab-ctl registry-database import --log-to-stdout
    
  6. 명령이 성공적으로 완료되면 레지스트리가 완전히 가져와집니다. 데이터베이스를 활성화하고, 구성에서 읽기 전용 모드를 해제하고, 레지스트리 서비스를 시작할 수 있습니다:

    registry['database'] = {
      'enabled' => true, # Must be enabled now!
    }
    
    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => false
        }
      }
    }
    
  7. 파일을 저장하고 GitLab을 재구성합니다.

  1. /etc/gitlab/gitlab.rb 파일의 registry['database'] 섹션에서 데이터베이스가 비활성화되어 있는지 확인합니다:

    registry['database'] = {
      'enabled' => false, # Must be false!
    }
    
  2. 레지스트리가 read-only 모드로 설정되어 있는지 확인합니다.

    /etc/gitlab/gitlab.rb를 편집하고 registry['storage'] 구성에 maintenance 섹션을 추가합니다. 예를 들어, gs://my-company-container-registry 버킷을 사용하는 gcs 백엔드 레지스트리의 경우 구성은 다음과 같을 수 있습니다:

    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => true # Must be set to true.
        }
      }
    }
    
  3. 파일을 저장하고 GitLab을 재구성합니다.

  4. 데이터베이스 마이그레이션을 적용합니다.

  5. 다음 명령을 실행합니다:

    sudo -u registry gitlab-ctl registry-database import --log-to-stdout
    
  6. 명령이 성공적으로 완료되면 레지스트리가 완전히 가져와집니다. 데이터베이스를 활성화하고, 구성에서 읽기 전용 모드를 해제하고, 레지스트리 서비스를 시작할 수 있습니다:

    registry['database'] = {
      'enabled' => true, # Must be enabled now!
    }
    
    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => false
        }
      }
    }
    
  7. 파일을 저장하고 GitLab을 재구성합니다.

사전 요건:

  1. /etc/gitlab/gitlab.rb 파일에 database 섹션을 추가하되, 메타데이터 데이터베이스가 비활성화된 상태로 시작합니다:

    registry['database'] = {
      'enabled' => false, # Must be false!
      'host' => '<registry_database_host_placeholder_change_me>',
      'port' => 5432, # Default, but set to the port of your database instance if it differs.
      'user' => '<registry_database_username_placeholder_change_me>',
      'password' => '<registry_database_placeholder_change_me>',
      'dbname' => '<registry_database_name_placeholder_change_me>',
      'sslmode' => 'require', # See the PostgreSQL documentation for additional information https://www.postgresql.org/docs/16/libpq-ssl.html.
      'sslcert' => '</path/to/cert.pem>',
      'sslkey' => '</path/to/private.key>',
      'sslrootcert' => '</path/to/ca.pem>'
    }
    
  2. 레지스트리가 read-only 모드로 설정되어 있는지 확인합니다.

    /etc/gitlab/gitlab.rb를 편집하고 registry['storage'] 구성에 maintenance 섹션을 추가합니다. 예를 들어, gs://my-company-container-registry 버킷을 사용하는 gcs 백엔드 레지스트리의 경우 구성은 다음과 같을 수 있습니다:

    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => true # Must be set to true.
        }
      }
    }
    
  3. 파일을 저장하고 GitLab을 재구성합니다.

  4. 아직 완료하지 않은 경우 데이터베이스 마이그레이션을 적용합니다.

  5. 다음 명령을 실행합니다:

    sudo gitlab-ctl registry-database import
    
  6. 명령이 성공적으로 완료되면 레지스트리가 완전히 가져와집니다. 이제 데이터베이스를 활성화하고, 구성에서 읽기 전용 모드를 해제하고, 레지스트리 서비스를 시작할 수 있습니다:

    registry['database'] = {
      'enabled' => true, # Must be enabled now!
      'host' => '<registry_database_host_placeholder_change_me>',
      'port' => 5432, # Default, but set to the port of your database instance if it differs.
      'user' => '<registry_database_username_placeholder_change_me>',
      'password' => '<registry_database_placeholder_change_me>',
      'dbname' => '<registry_database_name_placeholder_change_me>',
      'sslmode' => 'require', # See the PostgreSQL documentation for additional information https://www.postgresql.org/docs/16/libpq-ssl.html.
      'sslcert' => '</path/to/cert.pem>',
      'sslkey' => '</path/to/private.key>',
      'sslrootcert' => '</path/to/ca.pem>'
    }
    
    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => false
        }
      }
    }
    
  7. 파일을 저장하고 GitLab을 재구성합니다.

이제 모든 작업에 메타데이터 데이터베이스를 사용할 수 있습니다!

가져오기 후#

대규모 레지스트리는 가져오기 후 가비지 컬렉션 검토를 위해 수십만에서 수백만 개의 blob이 대기열에 추가될 수 있습니다. 이는 정상이며 기본 워커 간격으로는 처리에 시간이 걸립니다.

예상 동작과 처리 속도를 높이는 방법에 대한 안내는 다음을 참조하세요:

단계별 가져오기

Tier: Free, Premium, Ultimate
Offering: GitLab Self-Managed
원문 보기
요약

오프라인 가비지 컬렉션을 정기적으로 실행하는 경우 단계별 가져오기 방법을 사용하십시오. 가져오기 중에 레지스트리를 종료하거나 read-only 모드를 유지해야 합니다. /etc/gitlab/gitlab.rb 파일의 registry['database'] 섹션에서 데이터베이스가 비활성화되어 있는지 확인합니다:

오프라인 가비지 컬렉션을 정기적으로 실행하는 경우 단계별 가져오기 방법을 사용하십시오. 이 방법은 3단계 가져오기 방법에 비해 더 간단한 작업입니다.

단계별 가져오기#

Warning

가져오기 중에 레지스트리를 종료하거나 read-only 모드를 유지해야 합니다. 그렇지 않으면 가져오기 중에 작성된 데이터에 액세스할 수 없거나 일관성 문제가 발생합니다.

  1. /etc/gitlab/gitlab.rb 파일의 registry['database'] 섹션에서 데이터베이스가 비활성화되어 있는지 확인합니다:

    registry['database'] = {
      'enabled' => false, # Must be false!
    }
    
  2. 레지스트리가 read-only 모드로 설정되어 있는지 확인합니다.

    /etc/gitlab/gitlab.rb를 편집하고 registry['storage'] 구성에 maintenance 섹션을 추가합니다. 예를 들어, gs://my-company-container-registry 버킷을 사용하는 gcs 백엔드 레지스트리의 경우 구성은 다음과 같을 수 있습니다:

    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => true # Must be set to true.
        }
      }
    }
    
  3. 파일을 저장하고 GitLab을 재구성합니다.

  4. 데이터베이스 마이그레이션을 적용합니다.

  5. 다음 명령을 실행합니다:

    sudo gitlab-ctl registry-database import --log-to-stdout
    
  6. 명령이 성공적으로 완료되면 레지스트리가 완전히 가져와집니다. 데이터베이스를 활성화하고, 구성에서 읽기 전용 모드를 해제하고, 레지스트리 서비스를 시작할 수 있습니다:

    registry['database'] = {
      'enabled' => true, # Must be enabled now!
    }
    
    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => false
        }
      }
    }
    
  7. 파일을 저장하고 GitLab을 재구성합니다.

  1. /etc/gitlab/gitlab.rb 파일의 registry['database'] 섹션에서 데이터베이스가 비활성화되어 있는지 확인합니다:

    registry['database'] = {
      'enabled' => false, # Must be false!
    }
    
  2. 레지스트리가 read-only 모드로 설정되어 있는지 확인합니다.

    /etc/gitlab/gitlab.rb를 편집하고 registry['storage'] 구성에 maintenance 섹션을 추가합니다. 예를 들어, gs://my-company-container-registry 버킷을 사용하는 gcs 백엔드 레지스트리의 경우 구성은 다음과 같을 수 있습니다:

    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => true # Must be set to true.
        }
      }
    }
    
  3. 파일을 저장하고 GitLab을 재구성합니다.

  4. 데이터베이스 마이그레이션을 적용합니다.

  5. 다음 명령을 실행합니다:

    sudo -u registry gitlab-ctl registry-database import --log-to-stdout
    
  6. 명령이 성공적으로 완료되면 레지스트리가 완전히 가져와집니다. 데이터베이스를 활성화하고, 구성에서 읽기 전용 모드를 해제하고, 레지스트리 서비스를 시작할 수 있습니다:

    registry['database'] = {
      'enabled' => true, # Must be enabled now!
    }
    
    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => false
        }
      }
    }
    
  7. 파일을 저장하고 GitLab을 재구성합니다.

사전 요건:

  1. /etc/gitlab/gitlab.rb 파일에 database 섹션을 추가하되, 메타데이터 데이터베이스가 비활성화된 상태로 시작합니다:

    registry['database'] = {
      'enabled' => false, # Must be false!
      'host' => '<registry_database_host_placeholder_change_me>',
      'port' => 5432, # Default, but set to the port of your database instance if it differs.
      'user' => '<registry_database_username_placeholder_change_me>',
      'password' => '<registry_database_placeholder_change_me>',
      'dbname' => '<registry_database_name_placeholder_change_me>',
      'sslmode' => 'require', # See the PostgreSQL documentation for additional information https://www.postgresql.org/docs/16/libpq-ssl.html.
      'sslcert' => '</path/to/cert.pem>',
      'sslkey' => '</path/to/private.key>',
      'sslrootcert' => '</path/to/ca.pem>'
    }
    
  2. 레지스트리가 read-only 모드로 설정되어 있는지 확인합니다.

    /etc/gitlab/gitlab.rb를 편집하고 registry['storage'] 구성에 maintenance 섹션을 추가합니다. 예를 들어, gs://my-company-container-registry 버킷을 사용하는 gcs 백엔드 레지스트리의 경우 구성은 다음과 같을 수 있습니다:

    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => true # Must be set to true.
        }
      }
    }
    
  3. 파일을 저장하고 GitLab을 재구성합니다.

  4. 아직 완료하지 않은 경우 데이터베이스 마이그레이션을 적용합니다.

  5. 다음 명령을 실행합니다:

    sudo gitlab-ctl registry-database import
    
  6. 명령이 성공적으로 완료되면 레지스트리가 완전히 가져와집니다. 이제 데이터베이스를 활성화하고, 구성에서 읽기 전용 모드를 해제하고, 레지스트리 서비스를 시작할 수 있습니다:

    registry['database'] = {
      'enabled' => true, # Must be enabled now!
      'host' => '<registry_database_host_placeholder_change_me>',
      'port' => 5432, # Default, but set to the port of your database instance if it differs.
      'user' => '<registry_database_username_placeholder_change_me>',
      'password' => '<registry_database_placeholder_change_me>',
      'dbname' => '<registry_database_name_placeholder_change_me>',
      'sslmode' => 'require', # See the PostgreSQL documentation for additional information https://www.postgresql.org/docs/16/libpq-ssl.html.
      'sslcert' => '</path/to/cert.pem>',
      'sslkey' => '</path/to/private.key>',
      'sslrootcert' => '</path/to/ca.pem>'
    }
    
    ## Object Storage - Container Registry
    registry['storage'] = {
      'gcs' => {
        'bucket' => '<my-company-container-registry>',
        'chunksize' => 5242880
      },
      'maintenance' => {
        'readonly' => {
          'enabled' => false
        }
      }
    }
    
  7. 파일을 저장하고 GitLab을 재구성합니다.

이제 모든 작업에 메타데이터 데이터베이스를 사용할 수 있습니다!

가져오기 후#

대규모 레지스트리는 가져오기 후 가비지 컬렉션 검토를 위해 수십만에서 수백만 개의 blob이 대기열에 추가될 수 있습니다. 이는 정상이며 기본 워커 간격으로는 처리에 시간이 걸립니다.

예상 동작과 처리 속도를 높이는 방법에 대한 안내는 다음을 참조하세요: