您可以使用 Dataplex Universal Catalog 建構資料網格架構。本快速入門指南將說明如何使用 Dataplex Universal Catalog 功能 (例如湖泊、可用區和資產) 來建立資料網格。
資料網格是一種組織和技術方法,可將資料擁有權分散給多位網域資料擁有者。這些擁有者會以標準方式提供資料做為產品,並促進機構中不同部門之間的通訊,以便與不同位置的分散式資料集進行通訊。進一步瞭解資料網格架構。
目標
在本指南中,您將使用 Dataplex Universal Catalog 實體建構資料網格架構:
- 建立 Dataplex Universal Catalog 湖泊,做為資料網格的網域。
- 在自有湖泊中新增可用區,代表各網域內的個別團隊,並提供受管理資料合約。
- 附加對應至 Cloud Storage 中所儲存資料的資產。
費用
在本文件中,您會使用下列 Google Cloud的計費元件:
如要根據預測用量估算費用,請使用 Pricing Calculator。
完成本文所述工作後,您可以刪除已建立的資源,避免繼續計費。詳情請參閱清除所用資源一節。
事前準備
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator
(
roles/resourcemanager.projectCreator
), which contains theresourcemanager.projects.create
permission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Dataplex API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin
), which contains theserviceusage.services.enable
permission. Learn how to grant roles.
建立 Cloud Storage 值區
您需要 Cloud Storage bucket 來儲存資料網格的資料資產。
如要建立 Cloud Storage bucket,請按照「建立 Cloud Storage bucket」一文中的操作說明進行。採取這種策略時,請注意以下事項:
- 為 bucket 命名。
- 在「Location type」(位置類型) 中選擇「Region」(區域),然後從選單中選取「us-central1 (Iowa)」(us-central1 (愛荷華州))。
建立網域
在 Google Cloud 控制台,前往 Dataplex Universal Catalog 的「Lakes」(湖泊) 頁面。
按一下「建立」即可建立新湖泊,做為資料網格。
在「Display name」(顯示名稱) 欄位中,輸入
My data mesh
。在「Region」(區域) 中選取
us-central1
。選取您先前建立及設定的 Dataproc Metastore 服務做為相關聯的 Metastore。
點選「建立」。
在湖泊中建立區域
建立 Dataplex Universal Catalog 湖泊來建立網域後,您可以使用儲存區,在網域中代管受管理資料合約和個別團隊。儲存區有兩種類型:
原始區域通常用於將外部來源的任何格式資料儲存在 Cloud Storage 中。原始區域適合需要進一步處理才能使用的資料。
精選資料儲存區用於 Cloud Storage 中的結構化資料,這些資料必須符合特定檔案格式,並整理成與 Hive 相容的目錄配置方式。這類檢視畫面最適合用於可供使用和分析的資料。
每個網域 (例如 sales
、customers
、products
) 應至少有一個原始區域和一個精選區域。
其他區域則用於管理團隊之間的資料合約,或為特定網域內的團隊提供更精細的細目。例如產品網域內的商品目錄管理。資料擁有者可以管理網域內的資料並存取這些資料。
在 Google Cloud 控制台,前往 Dataplex Universal Catalog 的「管理」檢視畫面。
按一下要新增可用區的湖泊名稱 (
My data mesh
)。在「區域」分頁中,按一下「新增區域」
。在「Display name」(顯示名稱) 欄位中,輸入
My sub domain
。Dataplex Universal Catalog 會自動為儲存區產生 ID。在「Type」(類型) 中,選取「Raw zone」(原始區域)。
點選「建立」。
將資產連結至儲存區
將資料資產附加至儲存區。資料資產是包含資料的儲存資源,可以是 Cloud Storage bucket 或 BigQuery 資料集。這是建立資料網格架構的最後一個步驟。
在 Dataplex Universal Catalog 的「管理」檢視畫面中,點選您建立的湖泊 (
My data mesh
)。在「區域」分頁中,按一下要新增資產的區域 (
My sub domain
)。在「資產」分頁中,按一下
「新增資產」按一下「新增資產」。
在「Type」(類型) 部分,選取「Cloud Storage bucket」(Cloud Storage bucket)。
在「顯示名稱」欄位中,輸入
Data mesh asset
。Dataplex Universal Catalog 會自動為您產生資產 ID。在「Bucket」欄位中,按一下「Browse」(瀏覽)。
- 從清單中選取值區。
- 按一下「選取」。
依序點選「完成」和「繼續」。
按一下「繼續」即可沿用預設的「進階設定」。
按一下「提交」。
清除所用資源
如要避免系統向您的 Google Cloud 帳戶收取本教學課程中所用資源的相關費用,請刪除含有該項資源的專案,或者保留專案但刪除個別資源。
刪除專案
- In the Google Cloud console, go to the Manage resources page.
- In the project list, select the project that you want to delete, and then click Delete.
- In the dialog, type the project ID, and then click Shut down to delete the project.
刪除資料網格架構
在 Google Cloud 控制台,前往 Dataplex Universal Catalog 的「管理」檢視畫面。
找出要刪除的湖泊,然後依序點按「查看更多」
和「刪除」。如要確認這項操作,請輸入
delete
,然後按一下「刪除湖泊」。