5.3. 백업에서 IdM 서버 복원

다음 절차에서는 IdM 백업에서 IdM 서버 또는 해당 LDAP 데이터를 복원하는 방법을 설명합니다.

그림 5.1. 이 예에서 사용되는 복제 토폴로지

3개의 IdM 서버를 보여주는 다이어그램: 백업에서 호스트 server1.example.com을 복원해야 합니다. 호스트 caReplica2.example.com은 server1.example.com에 연결된 인증 기관 복제본입니다. 호스트 replica3.example.com은 caReplica2.example.com에 연결된 일반 서버입니다.

표 5.1. 이 예제에서 사용되는 서버 이름 지정 규칙

서버 호스트 이름함수

server1.example.com

백업에서 복원해야 하는 서버입니다.

caReplica2.example.com

server1.example.com 호스트에 연결된 CA(인증 기관) 복제본입니다.

replica3.example.com

caReplica2.example.com 호스트에 연결된 복제본입니다.

사전 요구 사항

  • ipa-backup 유틸리티를 사용하여 IdM 서버의 전체 서버 또는 데이터 전용 백업을 생성했습니다. 백업 생성을 참조하십시오.
  • 백업 파일은 /tmp 또는 /var/tmp 디렉토리에 없습니다.
  • 전체 서버 백업에서 전체 서버 복원을 수행하기 전에 서버에서 IdM을 제거하고 이전과 동일한 서버 구성을 사용하여 IdM을 다시 설치합니다.

절차

  1. ipa-restore 유틸리티를 사용하여 전체 서버 또는 데이터 전용 백업을 복원합니다.

    • 백업 디렉터리가 기본 /var/lib/ipa/backup/ 위치에 있는 경우 디렉터리 이름만 입력합니다.

      [root@server1 ~]# ipa-restore ipa-full-2020-01-14-12-02-32
    • 백업 디렉터리가 기본 위치에 없는 경우 전체 경로를 입력합니다.

      [root@server1 ~]# ipa-restore /mybackups/ipa-data-2020-02-01-05-30-00
      참고

      ipa-restore 유틸리티는 디렉터리에서 포함하는 백업 유형을 자동으로 감지하고 기본적으로 동일한 유형의 복원을 수행합니다. 전체 서버 백업에서 데이터 전용 복원을 수행하려면 ipa-restore 명령에 --data 옵션을 추가합니다.

      [root@server1 ~]# ipa-restore --data ipa-full-2020-01-14-12-02-32
  2. Directory Manager 암호를 입력합니다.

    Directory Manager (existing master) password:
  3. yes 를 입력하여 현재 데이터를 백업으로 덮어쓰는 것을 확인합니다.

    Preparing restore from /var/lib/ipa/backup/ipa-full-2020-01-14-12-02-32 on server1.example.com
    Performing FULL restore from FULL backup
    Temporary setting umask to 022
    Restoring data will overwrite existing live data. Continue to restore? [no]: yes
  4. ipa-restore 유틸리티는 사용 가능한 모든 서버에서 복제를 비활성화합니다.

    Each master will individually need to be re-initialized or
    re-created from this one. The replication agreements on
    masters running IPA 3.1 or earlier will need to be manually
    re-enabled. See the man page for details.
    Disabling all replication.
    Disabling replication agreement on server1.example.com to caReplica2.example.com
    Disabling CA replication agreement on server1.example.com to caReplica2.example.com
    Disabling replication agreement on caReplica2.example.com to server1.example.com
    Disabling replication agreement on caReplica2.example.com to replica3.example.com
    Disabling CA replication agreement on caReplica2.example.com to server1.example.com
    Disabling replication agreement on replica3.example.com to caReplica2.example.com

    그런 다음 유틸리티를 통해 IdM 서비스를 중지하고 백업을 복원한 다음 서비스를 다시 시작합니다.

    Stopping IPA services
    Systemwide CA database updated.
    Restoring files
    Systemwide CA database updated.
    Restoring from userRoot in EXAMPLE-COM
    Restoring from ipaca in EXAMPLE-COM
    Restarting GSS-proxy
    Starting IPA services
    Restarting SSSD
    Restarting oddjobd
    Restoring umask to 18
    The ipa-restore command was successful
  5. 복원된 서버에 연결된 모든 복제본을 다시 초기화합니다.

    1. 도메인 접미사의 모든 복제 토폴로지 세그먼트를 나열하고 복원된 서버와 관련된 토폴로지 세그먼트를 기록합니다.

      [root@server1 ~]# ipa topologysegment-find domain
      ------------------
      2 segments matched
      ------------------
        Segment name: server1.example.com-to-caReplica2.example.com
        Left node: server1.example.com
        Right node: caReplica2.example.com
        Connectivity: both
      
        Segment name: caReplica2.example.com-to-replica3.example.com
        Left node: caReplica2.example.com
        Right node: replica3.example.com
        Connectivity: both
      ----------------------------
      Number of entries returned 2
      ----------------------------
    2. 복원된 서버를 사용하여 모든 토폴로지 세그먼트에 대한 도메인 접미사를 다시 초기화합니다.

      이 예에서는 server1 의 데이터를 사용하여 caReplica2 의 다시 초기화를 수행합니다.

      [root@caReplica2 ~]# ipa-replica-manage re-initialize --from=server1.example.com
      Update in progress, 2 seconds elapsed
      Update succeeded
    3. 인증 기관 데이터로 이동하여 ca 접미사의 모든 복제 토폴로지 세그먼트를 나열합니다.

      [root@server1 ~]# ipa topologysegment-find ca
      -----------------
      1 segment matched
      -----------------
        Segment name: server1.example.com-to-caReplica2.example.com
        Left node: server1.example.com
        Right node: caReplica2.example.com
        Connectivity: both
      ----------------------------
      Number of entries returned 1
      ----------------------------
    4. 복원된 서버에 연결된 모든 CA 복제본을 다시 초기화합니다.

      이 예에서는 server1 의 데이터를 사용하여 csreplica 2의 re-initialization of caReplica2 를 수행합니다.

      [root@caReplica2 ~]# ipa-csreplica-manage re-initialize --from=server1.example.com
      Directory Manager password:
      
      Update in progress, 3 seconds elapsed
      Update succeeded
  6. 복원된 server1.example.com 에서 데이터로 모든 서버가 업데이트될 때까지 복제 토폴로지를 계속하여 연속 복제본을 다시 시작합니다.

    이 예제에서는 caReplica2 의 데이터가 포함된 replica3 에서 도메인 접미사만 다시 초기화해야 합니다.

    [root@replica3 ~]# ipa-replica-manage re-initialize --from=caReplica2.example.com
    Directory Manager password:
    
    Update in progress, 3 seconds elapsed
    Update succeeded
  7. 잘못된 데이터로 인해 인증 문제를 방지하려면 모든 서버에서 SSSD의 캐시를 지우십시오.

    1. SSSD 서비스를 중지합니다.

      [root@server ~]# systemctl stop sssd
    2. SSSD에서 캐시된 모든 콘텐츠를 삭제합니다.

      [root@server ~]# sss_cache -E
    3. SSSD 서비스를 시작합니다.

      [root@server ~]# systemctl start sssd
    4. 서버를 재부팅합니다.

추가 리소스

  • ipa-restore(1) 도움말 페이지는 복원 중에 복잡한 복제 시나리오를 처리하는 방법도 자세히 다룹니다.