本頁面說明各種錯誤情況,以及解決錯誤的疑難排解步驟。
連線和網路錯誤情境
如果服務發生連線或網路問題,請檢查下列各節中的情況,看看是否有其中一種情況導致問題。
因限制虛擬私有雲對等互連的限制而無法建立服務
請勿設定機構政策限制,以限制虛擬私有雲對等互連。指定 constraints/compute.restrictVpcPeering
會導致建立要求失敗,並顯示 INVALID_ARGUMENT
錯誤。如果您必須設定限制條件,請使用下列指令允許 under:folders/270204312590
:
gcloud resource-manager org-policies allow compute.restrictVpcPeering under:folders/270204312590 --organization ORGANIZATION_ID
詳情請參閱「組織政策限制」。
跨專案部署作業失敗,可能因為服務帳戶不存在
如要建立 Dataproc Metastore 服務,以便在屬於不同專案的網路中存取服務,您必須在網路專案的 IAM 政策中,將 roles/metastore.serviceAgent
授予服務專案的 Dataproc Metastore 服務代理 (service-SERVICE_PROJECT_NUMBER@gcp-sa-metastore.iam.gserviceaccount.com
)。
gcloud projects add-iam-policy-binding NETWORK_PROJECT_ID \
--role "roles/metastore.serviceAgent" \
--member "serviceAccount:service-SERVICE_PROJECT_NUMBER@gcp-sa-metastore.iam.gserviceaccount.com"
詳情請參閱「設定跨專案部署作業」。
無法建立跨區域 Dataproc Metastore 服務
建立多區域 Dataproc Metastore 服務時,您可能會看到下列錯誤:
The Dataproc Service Agent does not have permission to GET Dataproc Metastore service
'projects/<dpmsproject>/locations/nam7/services/<service>'. If using a service from the
cluster's project, please ensure the service agent has the Cloud IAM role
'roles/dataproc.serviceAgent'. Please see
https://cloud.google.com/dataproc/docs/concepts/iam/dataproc-
principals#service_agent_control_plane_identity for information on the Dataproc Service
Agent, and https://cloud.google.com/iam/docs/granting-changing-revoking-access#granting-
gcloud-manual for information on granting access.
如果 Dataproc 叢集位於與 Dataproc Metastore 不同的專案中,但您未授予專案正確的權限,就會發生這個錯誤。
如要解決這項錯誤,請務必將 metastore.services.get
權限授予 Dataproc Metastore 專案中包含的 Dataproc 服務帳戶。
網路連線必須使用私人 IP
Dataproc Metastore 只會使用私人 IP,因此不會公開任何公開 IP。也就是說,只有提供的虛擬私有雲網路 (VPC) 網路或內部部署 (透過 Cloud VPN 或 Cloud Interconnect 連線) 的 VM 才能存取 Dataproc Metastore 服務。
詳情請參閱「服務存取權」。
Kerberos 所需的輸入允許防火牆規則
Kerberos 需要 Dataproc Metastore 啟動與專案網路中主機的連線。您必須建立防火牆規則,允許來自包含 Dataproc Metastore IP 的 /17
IP 區塊,在所有通訊埠上輸入 TCP 和 UDP。
詳情請參閱「KDC 上的防火牆規則」和「服務的防火牆規則」。
共用虛擬私有雲網路中佈建的資源導致連線錯誤
如果您的 Dataproc Metastore 在這種情況下,Dataproc Metastore 會嘗試保留 RFC 1918 範圍以外的私人 IP 位址範圍,以便建立服務。如需支援的非 RFC 1918 私人範圍清單,請參閱 VPC 網路說明文件中的「有效範圍」。} 服務使用屬於不同專案的網路,而 Compute Engine 受到服務邊界保護,則中繼資料庫專案和網路專案必須位於相同邊界。
如要將現有的 Dataproc Metastore 專案新增至範圍,請按照「更新服務範圍」一節中的指示操作。
詳情請參閱「透過 Dataproc Metastore 使用 VPC Service Controls」。
已用盡分配的 IP 範圍
提供的 VPC 網路可能會耗盡 Dataproc Metastore 服務所需的 RFC 1918 位址。在這種情況下,Dataproc Metastore 會嘗試保留 RFC 1918 範圍以外的私人 IP 位址範圍,以便建立服務。如需支援的非 RFC 1918 私人範圍清單,請參閱 VPC 網路說明文件中的「有效範圍」。
在 Dataproc Metastore 中使用的非 RFC 1918 私人 IP 位址,可能會與連線至提供的虛擬私有雲網路的內部部署網路中的範圍衝突。如要查看 Dataproc Metastore 保留的 RFC 1918 和非 RFC 1918 私人 IP 位址清單,請按照下列步驟操作:
gcloud compute addresses list \
--project NETWORK_PROJECT_ID \
--filter="purpose:VPC_PEERING AND name ~ cluster|resourcegroup"
如果發現有衝突,且無法透過重新設定內部網路來緩解,請刪除有問題的 Dataproc Metastore 服務,並在 2 小時後重新建立。
詳情請參閱「IP 位址範圍用盡」。
作業逾時錯誤情境
下列錯誤情況會導致服務或作業逾時而無回應。
使用稽核記錄排解作業逾時問題
如要排解服務作業逾時問題,請使用Google Cloud 控制台中的記錄檔探索工具,擷取 Cloud 專案的稽核記錄項目。
在「查詢建構工具」窗格中,選取「Audited Resource」或 audited_resource
做為 Google Cloud 資源類型,接著選取「Dataproc Metastore」或 metastore.googleapis.com
做為服務。您可以選擇不選取方法。
詳情請參閱「查看記錄」。
匯入和匯出錯誤情境
本節將概略說明 Dataproc Metastore 的常見匯入和匯出問題。
匯入失敗,因為 Hive 版本不相符
匯入中繼資料時,Hive 中繼存放區和 Dataproc Metastore 的版本必須相容。如果兩者不相符,匯入作業可能會失敗。
如要進一步瞭解相容性,請參閱「版本政策」。
您可以查看 Cloud Logging,瞭解是否遇到這項錯誤。以下訊息是這項錯誤的範例。
Metastore schema version is not compatible. Hive Version: 3.1.0, Database Schema Version: 2.3.0
缺少 Hive 資料表檔案,因此匯入失敗
準備 Avro 匯入作業時,每個 Hive 資料表都應有一個檔案,即使資料表為空白也一樣,否則匯入作業會失敗。
您可以參考 Dataproc Metastore Toolkit,確認 Hive 中繼資料架構是否正確。
服務代理或使用者沒有必要的權限
Dataproc Metastore 服務代理人 (service-CUSTOMER_PROJECT_NUMBER@gcp-sa-metastore.iam.gserviceaccount.com
) 和匯入中繼資料的使用者,必須對用於匯入的 Cloud Storage 值區具備下列讀取權限:
針對 MySQL,他們必須對用於匯入的 Cloud Storage 物件 (SQL 傾印檔案) 擁有
storage.objects.get
權限。針對 Avro,他們必須具備用於匯入作業的 Cloud Storage 值區的
storage.objects.get
權限。
對於匯出作業,Dataproc Metastore 服務代理 (service-CUSTOMER_PROJECT_NUMBER@gcp-sa-metastore.iam.gserviceaccount.com
) 和建立匯出作業的使用者,必須具備值區的 storage.objects.create
權限。
資料庫檔案過大,因此工作失敗
如果資料庫檔案太大,匯入或匯出程序可能會超過工作逾時限制。如果匯入作業無法在 3 小時的工作逾時限制內完成,您可以將中繼資料分割至多個 Dataproc Metastore 執行個體。
備份與還原錯誤情境
本節將概略說明 Dataproc Metastore 的常見備份與還原問題。
無法為服務建立新的備份
如果服務中已有 7 個備份,您必須先手動刪除備份,才能建立新的備份。您可以透過「備份/還原」分頁刪除現有的備份。
使用者沒有必要權限
如要備份中繼資料,您必須要求含有 metastore.backups.create
IAM 權限的 IAM 角色。
如要還原中繼資料,您必須要求含有 metastore.services.restore
和 metastore.backups.use
IAM 權限的 IAM 角色。
服務中繼資料檔案過大,因此工作失敗
如果服務中繼資料檔案太大,可能需要超過一小時的工作逾時限制才能完成備份或還原程序。
Dataproc 叢集錯誤情境
以下各節將概略說明 Dataproc 和自管叢集的常見問題。
因版本不相符而無法附加 Dataproc 叢集
連結 Dataproc 叢集時,Dataproc 映像檔和 Dataproc Metastore Hive 版本必須相容。請查看下列圖片版本管理頁面,確認 Hive 版本是否相容:
- Dataproc 2.0.x 發布版本
- Dataproc 1.5.x 發布版本
- Dataproc 1.4.x 發布版本
詳情請參閱 Dataproc 映像檔版本清單。
角色不足,因此無法建立 Dataproc 叢集
建立 Dataproc 叢集時,叢集建立作業會失敗,並顯示以下錯誤訊息:
gcloud.dataproc.clusters.create) INVALID_ARGUMENT: Default Service Account '**********-compute@developer.gserviceaccount.com' is missing required permissions: [dataproc.agents.create, dataproc.agents.delete, dataproc.agents.get, dataproc.agents.update, dataproc.tasks.lease, dataproc.tasks.listInvalidatedLeases, dataproc.tasks.reportStatus]. Service Accounts must have either 'Dataproc/Dataproc Worker' role or all permissions granted by the role.
當您嘗試建立 Dataproc 叢集並將其附加至 Dataproc Metastore 時,就可能發生這種情況。
如要解決這個問題,請將 roles/dataproc.worker
授予服務帳戶。以下範例說明如何使用一些範例值執行這項操作。
gcloud projects add-iam-policy-binding my_project \ --member=219315-compute@developer.gserviceaccount.com \ --role=roles/dataproc.worker
因時區問題導致無法連線至 Metastore
Hive 檔案傳回 The server time zone value 'CDT' is
unrecognized or represents more than one time zone
錯誤。
如果您無法透過 Dataproc 連線至元資料儲存庫,則必須刪除目前的叢集,並更新 gcloud dataproc clusters create
指令或自動化工具,以納入下列時區參數:
--metadata "hive-metastore-uri=jdbc:mysql://10.207.26.77:3306/hive_metastore?serverTimezone=CST6CDT"
排解 Google Cloud CLI 問題
如果您遇到無法使用 gcloud CLI 指令的問題,或是指令的行為與說明文件中描述的不同,請嘗試更新 gcloud CLI:
gcloud components update
後續步驟
- 如要解決錯誤,請參閱「錯誤訊息」。