快速入門導覽課程:建立及設定湖泊
本快速入門導覽課程說明如何透過Google Cloud 控制台開始使用 Dataplex Universal Catalog,包括逐步引導您建立湖泊、新增儲存區,以及連結資產。
事前準備
- 登入 Google Cloud 帳戶。如果您是 Google Cloud新手,歡迎 建立帳戶,親自評估產品在實際工作環境中的成效。新客戶還能獲得價值 $300 美元的免費抵免額,可用於執行、測試及部署工作負載。
-
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 role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Dataplex, Managed Service for Apache Spark, Dataproc Metastore, BigQuery, and Cloud Storage APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
Make sure that you have the following role or roles on the project:
roles/dataplex.admin,roles/dataplex.editorCheck for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
- Click Grant access.
-
In the New principals field, enter your user identifier. This is typically the email address for a Google Account.
- Click Select a role, then search for the role.
- To grant additional roles, click Add another role and add each additional role.
- Click Save.
-
-
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 role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Dataplex, Managed Service for Apache Spark, Dataproc Metastore, BigQuery, and Cloud Storage APIs.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
Make sure that you have the following role or roles on the project:
roles/dataplex.admin,roles/dataplex.editorCheck for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
- Click Grant access.
-
In the New principals field, enter your user identifier. This is typically the email address for a Google Account.
- Click Select a role, then search for the role.
- To grant additional roles, click Add another role and add each additional role.
- Click Save.
-
- 建立 Cloud Storage bucket:
- 前往 Google Cloud 控制台的 Cloud Storage「Buckets」(值區) 頁面。
- 點選 「Create」(建立)。
- 在「建立 bucket」頁面中,輸入 bucket 資訊。如要前往下一個步驟,請按「繼續」。
- 在「Name your bucket」(為 bucket 命名) 欄位中,輸入 bucket 的專屬名稱。請勿在 bucket 名稱中加入任何機密資訊,因為 bucket 命名空間全域通用並會公開顯示。
-
在「Choose where to store your data」(選擇資料的儲存位置) 專區中,執行下列操作:
- 選取「位置類型」。
- 從「位置類型」下拉式選單中,選擇要永久儲存 bucket 資料的位置。
- 如果您選取「雙區域」位置類型,也可以使用相關核取方塊啟用強化型複製。
- 如要設定跨值區複製,請選取「透過 Storage 移轉服務新增跨值區複製作業」,然後按照下列步驟操作:
設定跨 bucket 複製作業
- 在「Bucket」選單中選取 bucket。
在「複製設定」部分,按一下「設定」,設定複製作業的設定。
系統隨即會顯示「設定跨 bucket 複製作業」窗格。
- 如要依物件名稱前置字串篩選要複製的物件,請輸入要納入或排除物件的前置字串,然後按一下「新增前置字串」。
- 如要為複製的物件設定儲存空間級別,請從「儲存空間級別」選單中選取儲存空間級別。如果略過這個步驟,複製的物件預設會使用目標值區的儲存空間級別。
- 按一下 [完成]。
-
在「選擇資料儲存方式」部分,執行下列操作:
- 在「設定預設類別」部分,選取「Standard」。
- 如要啟用階層命名空間,請在「為資料密集型工作負載提供最理想的儲存空間」部分,選取「為這個值區啟用階層命名空間」。
- 在「選取如何控制物件的存取權」部分,選取 bucket 是否要強制執行禁止公開存取,並為 bucket 的物件選取存取控管方法。
-
在「選擇保護物件資料的方式」部分,執行下列操作:
- 選取「資料保護」下方的任何選項,為 bucket 設定所需項目。
- 如要啟用虛刪除,請按一下「虛刪除政策 (用於資料復原)」核取方塊,並指定要保留物件的天數 (刪除後)。
- 如要設定「物件版本管理」,請按一下「物件版本管理 (用於版本管控)」核取方塊,並指定每個物件的版本數量上限,以及非現行版本失效的天數。
- 如要為物件和 bucket 啟用資料保留政策,請勾選「保留 (符合法規)」核取方塊,然後執行下列操作:
- 如要啟用 Object Retention Lock,請按一下「啟用物件保留功能」核取方塊。
- 如要啟用 Bucket Lock,請勾選「Set bucket retention policy」(設定值區資料保留政策) 核取方塊,然後選擇保留期限的時間單位和長度。
- 如要選擇物件資料的加密方式,請展開「資料加密」部分 (),然後選取「資料加密」方法。
- 選取「資料保護」下方的任何選項,為 bucket 設定所需項目。
- 點選「建立」。
建立湖泊
湖泊是代表資料網域或業務單位的邏輯建構體。舉例來說,如要依群組用量整理資料,請為每個部門 (例如零售、銷售和財務) 建立湖泊。
下列步驟說明如何使用 Google Cloud 控制台建立資料湖。
在 Google Cloud 控制台,前往 Dataplex Universal Catalog 的「Lakes」(湖泊) 頁面。
點選 「建立」。
輸入顯示名稱。
系統會自動產生湖泊 ID。
指定要建立資料湖泊的「Region」(區域)。
如果是在特定區域 (例如
us-central1) 建立的湖泊,可以根據可用區設定來附加單一區域 (us-central1) 資料和多區域 (us multi-region) 資料。點選「建立」。
在湖泊中新增儲存區
建立湖泊後,就能在湖泊中新增儲存區。儲存區是湖泊中的邏輯分組,有助於分類結構化和非結構化資料。
在「管理」檢視畫面中,按一下要新增可用區的湖泊名稱。
按一下 「新增區域」。
輸入區域的顯示名稱。
按一下「類型」下拉式選單。選擇「Raw Zone」(原始可用區) 或「Curated Zone」(收錄的可用區)。進一步瞭解區域類型。
在「資料位置」下方,選取「區域性」或「多區域」。 選定後即無法變更。在同一個可用區中,單一區域和多區域的資料不得混用。
點選「建立」。
系統應該會在幾分鐘內建立儲存區。
附加資產
資料可儲存在 Cloud Storage bucket 或 BigQuery 資料集中,並可做為資產,連結至 Dataplex Universal Catalog 湖泊中的資料儲存區。
如要將 Cloud Storage bucket 附加為資產,請按照下列步驟操作:
在「管理」檢視畫面中,按一下要附加 Cloud Storage bucket 的湖泊名稱。
在「區域」分頁中,點按要新增資產的區域。
在「資產」分頁中,按一下「新增資產」。
點選「Add an asset」。
在「Type」(類型) 下方,選取「Storage bucket」(儲存空間 bucket)。
在「顯示名稱」下方輸入資產名稱。
在「Bucket」欄位中,按一下「Browse」(瀏覽)。如果您有 Cloud Storage bucket,請找出並點按「選取」。如果沒有 Cloud Storage bucket,可以點選 按鈕建立一個。
輸入 bucket 的專屬名稱。按一下「繼續」。
選擇「位置類型」。按一下「Continue」(繼續)。
為資料選擇預設儲存空間級別。按一下「繼續」。
選擇存取控管層級。按一下「繼續」。
選擇資料保護選項或「無」。按一下「Continue」(繼續)。
點選「建立」。
按一下「Select」。
按一下 [完成]。
按一下「繼續」。
按一下「繼續」。
在「新增資產」下方,按一下「提交」。
等待資產建立完成。
清除所用資源
為了避免系統向您的 Google Cloud 帳戶收取本頁面所用資源的費用,請按照下列步驟操作。
- 前往 Google Cloud 控制台的「Manage resources」(管理資源) 頁面。
- 如果您要刪除的專案已附加至某個機構,請展開「名稱」欄中的「機構」清單。
- 在專案清單中選取要刪除的專案,然後點選「Delete」(刪除)。
- 在對話方塊中輸入專案 ID,然後按一下 [Shut down] (關閉) 以刪除專案。
或者,您也可以刪除本教學課程中使用的資源。您必須刪除湖泊的所有資料區資源,湖泊才會遭到刪除。同樣地,除非刪除所有資產資源,否則資料區域不會刪除。
卸離儲存空間 bucket
如要取消連結您建立的 Dataplex Universal Catalog 資產,請按照下列步驟操作:
在 Google Cloud 控制台,前往 Dataplex Universal Catalog 的「Lakes」(湖泊) 頁面。
按一下您建立的湖泊名稱。
在「可用區」分頁中,點選您建立的可用區名稱。
在「資產」分頁中,勾選 bucket 名稱左側的方塊,選取要卸離的資產。
按一下「刪除資產」。
按一下「刪除」確認解除連結。
刪除區域
如要刪除您建立的 Dataplex Universal Catalog 區域,請按照下列步驟操作:
在 Google Cloud 控制台,前往 Dataplex Universal Catalog 的「Lakes」(湖泊) 頁面。
按一下您建立的湖泊。
在「可用區」分頁中,勾選資料可用區名稱左側的方塊,選取要刪除的可用區。
按一下「Delete Zone」(刪除區域)。
點選「刪除」即可確認刪除。
刪除湖泊
下列步驟說明如何刪除您建立的 Dataplex Universal Catalog 湖泊。
在 Google Cloud 控制台,前往 Dataplex Universal Catalog 的「Lakes」(湖泊) 頁面。
按一下您建立的湖泊。
按一下頁面頂端的「刪除」。
在欄位中輸入「delete」,確認刪除。
按一下「刪除湖泊」確認刪除。