키 저장소 독립형 백업을 복원한 후 다음 절차에 따라 KEK를 복호화하고, 새 로컬 키 저장소를 사용하여 다시 암호화하고, 내부 데이터베이스의 키 항목을 업데이트하세요.
Looker를 중지합니다.
cd looker
./looker stop
Looker가 클러스터링된 경우 계속하기 전에 모든 노드를 중지해야 합니다.
나중에 restore_dr_backup 명령어를 실행할 때 노드가 계속 실행 중이면 명령어가 실패하고 다음 메시지가 표시됩니다. "이 백엔드 Looker 데이터베이스에 연결된 다른 라이브 노드가 있습니다. Looker가 최근 1분 내에 종료된 경우 잠시 후 다시 시도하세요. 그렇지 않으면 클러스터의 모든 노드가 종료되어 있는지 확인합니다."
Looker를 복원한 위치의 로컬 키 저장소에 사용되는 CMK에 Looker가 액세스할 수 있는지 확인합니다. 복원 위치의 CMK가 파일에 저장된 경우 환경 변수 LKR_MASTER_KEY_FILE을 사용하여 CMK 파일의 경로를 가리킬 수 있습니다.
export LKR_MASTER_KEY_FILE=<path_to_CMK_file>
또는 복원 위치의 CMK를 환경 변수에 직접 제공하려면 LKR_MASTER_KEY_ENV 환경 변수를 사용하면 됩니다.
export LKR_MASTER_KEY_ENV=<CMK_value>
내부 데이터베이스를 업데이트합니다.
./looker restore_dr_backup <path_to_CMK_file>
여기서 <path_to_CMK_file>은 키 저장소 독립형 백업이 생성될 때 생성된 일반 텍스트 키 파일의 경로와 파일 이름입니다. 키 파일의 형식은 다음과 같습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-31(UTC)"],[],[],null,["# Restoring backups\n\n| **Warning:** If your instance is customer-hosted, do not modify LookML files directly on the filesystem of your instance. This can cause unexpected errors in your Git workflow. To make changes to your LookML files, follow the steps at [Using version control and deploying](/looker/docs/version-control-and-deploying-changes).\n\nTo learn about *creating* Looker backups, see the [Creating backups](/looker/docs/creating-backups) documentation page.\n\nTo *restore* a customer-hosted Looker instance to a new host, complete only these steps of the [Looker installation instructions](/looker/docs/installing-looker-application):\n\n- Verify that the new server complies with the minimum server specifications.\n- Enable ntpd or chronyd.\n- Create the **looker** user, group, and home directory.\n- Skip downloading the Looker application and all remaining installation steps.\n\nOnce the new host is prepared:\n\n- Restore the files from backup.\n- Start Looker:\n\n sudo su - looker\n cd looker\n ./looker start\n\nClustered environments\n----------------------\n\nTo restore the MySQL database for a clustered environment:\n\n- Stop any running Lookers in the cluster.\n- Restore the database.\n- Start the Looker instances one at a time.\n\nSee the [MySQL documentation](https://dev.mysql.com/doc/refman/5.0/en/backup-and-recovery.html) for more details on how to restore MySQL databases.\n\nRestoring a keystore-independent backup\n---------------------------------------\n\nCustomer-hosted installations that have [migrated to AES-256 GCM encryption](/looker/docs/migrating-to-aes-256-gcm-encryption) and [generated a keystore-independent backup](/looker/docs/creating-backups#generating_a_keystore-independent_backup) need to update Looker's internal database after performing a restore.\n\nAfter restoring a keystore-independent backup, follow this procedure to decrypt the KEK, re-encrypt it using the new local keystore, and update the key entry in the internal database:\n\n1. Stop Looker:\n\n cd looker\n ./looker stop\n\n If Looker is clustered, make sure to stop every node before proceeding.\n\n If any nodes are still running when you later issue the `restore_dr_backup` command, the command will fail with the message, \"There are other live nodes connected to this backend Looker database. If Looker was shutdown within the last minute, try again shortly, otherwise verify all nodes in the cluster are shut down.\"\n2. Ensure that Looker can access the CMK used for the local keystore of the location where you restored Looker. If the CMK of the restore location is stored in a file, you can use the environment variable `LKR_MASTER_KEY_FILE` to point to the path of the CMK file:\n\n export LKR_MASTER_KEY_FILE=\u003cpath_to_CMK_file\u003e\n\n or, if you want to provide the CMK of the restore location directly in an environment variable, you can use the `LKR_MASTER_KEY_ENV` environment variable: \n\n export LKR_MASTER_KEY_ENV=\u003cCMK_value\u003e\n\n3. Update the internal database:\n\n ./looker restore_dr_backup \u003cpath_to_CMK_file\u003e\n\n where `\u003cpath_to_CMK_file\u003e` is the path and filename of the plain text key file created when the keystore-independent backup was made. The key file has the following format: \n\n {\"dbmk\":\"vr1LUwO3q6weY8iS3JykVljSjiD4m6eGk227Cs7Qu9Q=\\n\",\"backup_uid\":\"XCXvRa38mNeqT6+HRBCo2Q==\"}\n\n where the value for `dbmk` is a Base64 encoding 256-bit encryption key and `backup_uid` is a unique name used when saving the key to the database.\n\nAfter you have updated Looker's internal database, you can start Looker normally. Once Looker is running, we recommend that you delete the plaintext key file used to create the keystore-independent backup."]]