本頁說明各種錯誤情況,以及解決錯誤的疑難排解步驟。
連線和網路錯誤情境
如果服務發生連線或網路問題,請查看下列各節中的情境,確認是否為問題原因。
由於限制虛擬私有雲對等互連的限制,因此無法建立服務
請勿設定機構政策限制來限制虛擬私有雲對等互連。指定 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 啟動與專案網路中主機的連線。您必須建立防火牆規則,允許來自 /17
IP 區塊的所有通訊埠進行 TCP 和 UDP 輸入,該區塊包含 Dataproc Metastore IP。
詳情請參閱「KDC 上的防火牆規則」和「服務的防火牆規則」。
共用虛擬私有雲網路中佈建的資源導致連線錯誤
如果您的 Dataproc Metastore 如果發生這種情況,Dataproc Metastore 會嘗試保留 RFC 1918 範圍以外的私人 IP 位址範圍,以建立服務。如需支援的非 RFC 1918 私人範圍清單,請參閱虛擬私有雲網路說明文件中的「有效範圍」。} 服務使用的網路屬於不同專案,且 Compute Engine 受服務安全防護範圍保護,則中繼資料存放區專案和網路專案必須位於相同安全防護範圍。
如要將現有的 Dataproc Metastore 專案新增至範圍,請按照「更新服務範圍」一文中的操作說明進行。
詳情請參閱「透過 Dataproc Metastore 使用 VPC Service Controls」。
分配的 IP 範圍已用盡
提供的虛擬私有雲網路可能沒有 Dataproc Metastore 服務所需的可用 RFC 1918 位址。如果發生這種情況,Dataproc Metastore 會嘗試保留 RFC 1918 範圍以外的私人 IP 位址範圍,以建立服務。如需支援的非 RFC 1918 私人範圍清單,請參閱 VPC 網路說明文件中的「有效範圍」。
Dataproc Metastore 中使用的非 RFC 1918 私人 IP 位址,可能會與連線至所提供 VPC 網路的地端部署網路中的範圍衝突。如要查看 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 位址範圍耗盡」。
作業逾時錯誤情境
下列錯誤情況會導致服務無回應或作業逾時。
使用稽核記錄排解作業逾時問題
如要排解服務作業逾時問題,請使用控制台中的記錄檔探索工具,擷取 Cloud 專案的稽核記錄項目。Google Cloud
在「查詢建構工具」窗格中,選取「已稽核的資源」或 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
後續步驟
- 如要解決錯誤,請參閱「錯誤訊息」。