建立免費試用執行個體並匯入範例資料

這份 Bigtable 免付費試用執行個體快速入門導覽課程,將逐步說明如何設定 Bigtable 免付費試用執行個體,並瞭解 Bigtable 功能。

Bigtable 免費試用執行個體可讓您免付費學習及探索 Bigtable 的功能,且為期 90 天。如要進一步瞭解 Bigtable 免費試用方案和 Bigtable 免費試用執行個體,請參閱免費試用方案總覽

在本快速入門導覽課程中,您將執行下列操作:

  • 在 Google Cloud 控制台建立 Bigtable 免費試用執行個體。
  • 使用 Bigtable Studio 對範例資料執行查詢。
  • 匯入 100 GB 的範例資料,進行效能測試。
  • 使用 Cloud Shell 將自有資料匯入 Bigtable 免費試用執行個體。

事前準備

  • 凡是擁有 Google 帳戶的使用者,都能享有 10 天的試用期。
  • 如果專案已啟用 Cloud Billing,且包含 Bigtable 免費試用執行個體,則 10 天的試用期可以延長至 90 天。除非您選擇將 Bigtable 免費試用執行個體升級為付費執行個體,否則我們不會向您收費。
  • 刪除 Bigtable 免費試用執行個體後,即使 90 天試用期尚未結束,也無法再次建立執行個體
  • 啟用 API 並指派 IAM 角色:
    1. 登入 Google Cloud 帳戶。如果您是 Google Cloud新手,歡迎 建立帳戶,親自評估產品在實際工作環境中的成效。新客戶還能獲得價值 $300 美元的免費抵免額,可用於執行、測試及部署工作負載。
    2. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

      Go to project selector

    3. Enable the Cloud Bigtable and Cloud Bigtable Admin APIs.

      Roles required to enable APIs

      To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

      Enable the APIs

    4. Make sure that you have the following role or roles on the project: roles/bigtable.admin

      Check for the roles

      1. In the Google Cloud console, go to the IAM page.

        Go to IAM
      2. Select the project.
      3. 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.

      4. 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

      1. In the Google Cloud console, go to the IAM page.

        Go to IAM
      2. Select the project.
      3. Click Grant access.
      4. In the New principals field, enter your user identifier. This is typically the email address for a Google Account.

      5. Click Select a role, then search for the role.
      6. To grant additional roles, click Add another role and add each additional role.
      7. Click Save.
    5. 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 the resourcemanager.projects.create permission. Learn how to grant roles.

      Go to project selector

    6. Enable the Cloud Bigtable and Cloud Bigtable Admin APIs.

      Roles required to enable APIs

      To enable APIs, you need the Service Usage Admin IAM role (roles/serviceusage.serviceUsageAdmin), which contains the serviceusage.services.enable permission. Learn how to grant roles.

      Enable the APIs

    7. Make sure that you have the following role or roles on the project: roles/bigtable.admin

      Check for the roles

      1. In the Google Cloud console, go to the IAM page.

        Go to IAM
      2. Select the project.
      3. 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.

      4. 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

      1. In the Google Cloud console, go to the IAM page.

        Go to IAM
      2. Select the project.
      3. Click Grant access.
      4. In the New principals field, enter your user identifier. This is typically the email address for a Google Account.

      5. Click Select a role, then search for the role.
      6. To grant additional roles, click Add another role and add each additional role.
      7. Click Save.

建立 Bigtable 免費試用執行個體

下列步驟說明如何使用 Google Cloud 控制台建立 Bigtable 免費試用執行個體。

  1. 在 Google Cloud 控制台中開啟「Welcome to Bigtable」(歡迎使用 Bigtable) 頁面。

    歡迎使用 Bigtable

  2. 在「免付費體驗 Bigtable,無須綁約」部分,輸入下列資訊:

    1. 在「Instance name」(執行個體名稱) 中,輸入執行個體的名稱。例如:Free trial instance
    2. (選用) 在「執行個體 ID」中,查看自動產生的執行個體 ID,並視需要變更。本指南中的範例使用 free-trial-instance ID。
    3. 在「區域」部分,選取您附近的區域。
    4. 在「可用區」部分,選取「任何」
  3. 按一下「建立免費執行個體」

瞭解 Bigtable 基本概念

您可以在 Google Cloud 控制台的 Bigtable 免費試用執行個體介面中,選擇參加互動式教學課程,瞭解並試用 Bigtable 基礎知識。

您也可以在 Bigtable 免費試用例項的總覽中,觀看這部 4 分鐘的簡介影片:

  1. 在 Google Cloud 控制台中開啟 Bigtable 執行個體清單。

    開啟執行個體清單

  2. 按一下 Bigtable 免費試用執行個體 (free-trial-instance)。

  3. 在導覽窗格中,按一下「總覽」

  4. 在「充分運用免費執行個體」部分,選取「Bigtable 基礎知識」,然後點選「播放影片」

  5. 如要完成這個教學課程步驟,請按一下「標示為完成」

查詢範例資料

在Google Cloud 控制台中建立 Bigtable 免費試用執行個體時,Bigtable 會建立範例資料表和範例查詢,供您探索及熟悉 Bigtable 的功能。

weather-data 資料表包含全球各地機場回報的範例天氣資料。如要在 Bigtable Studio 中對這個資料表執行查詢範例,請按照下列步驟操作:

  1. 在 Google Cloud 控制台中開啟 Bigtable 執行個體清單。

    開啟執行個體清單

  2. 按一下 Bigtable 免費試用執行個體 (free-trial-instance)。

  3. 在導覽窗格中,按一下「總覽」

  4. 在「充分運用免費執行個體」部分,選取「查詢資料表」,然後按一下「查詢資料表」

    簡短的歡迎導覽會說明 Bigtable Studio 的 SQL 查詢基礎知識。

  5. 以下是 Bigtable Studio 中為範例資料建立的查詢:

    SELECT *
    FROM `weather-data`(WITH_HISTORY=>FALSE)
    LIMIT 10;
    
  6. 按一下「執行」。查詢結果會顯示在「結果」表格中。

  7. 如要完成這個教學課程步驟,請返回「總覽」,然後按一下「標示為完成」

探索範例查詢

免費執行個體提供更多範例查詢,供您探索。您可以在「查詢」部分查看這些查詢。

  1. 在 Google Cloud 控制台中開啟 Bigtable 執行個體清單。

    開啟執行個體清單

  2. 按一下 Bigtable 免費試用執行個體 (free-trial-instance)。

  3. 在導覽窗格中,按一下「Bigtable Studio」

  4. 在「Explorer」窗格中,展開「Queries」

  5. 瀏覽範例查詢,瞭解 Bigtable 查詢的不同面向。

    如要進一步瞭解查詢語法,請參閱 Bigtable 適用的 GoogleSQL 總覽

匯入效能基準的測試資料表

如要瞭解 Bigtable 在處理大量資料時的功能,可以匯入測試資料表,執行實際的效能基準測試,並探索監控工具。測試資料表包含 100 GB 的範例資料,這些資料是以 Yahoo! Cloud Serving Benchmark (YCSB) 測試。

如要匯入效能測試資料表,請按照下列步驟操作:

  1. 在 Google Cloud 控制台中開啟 Bigtable 執行個體清單。

    開啟執行個體清單

  2. 按一下 Bigtable 免費試用執行個體 (free-trial-instance)。

  3. 在導覽窗格中,按一下「總覽」

  4. 在「充分運用免費執行個體」部分,選取「Bigtable 效能」,然後按一下「匯入 YCSB 資料」,並等待資料表建立完成。

  5. 按一下導覽窗格中的「表格」,然後點選 YCSB 表格。

  6. YCSB 資料表填入資料後,您就可以在 Bigtable Studio 中查詢該資料表。

  7. 如要完成這個教學課程步驟,請返回「總覽」,然後按一下「標示為完成」

如要深入瞭解,請參閱 Bigtable 的 PerfKitBenchmarker 教學課程,建立專為特定用途設計的自訂測試。如要進一步瞭解效能測試,請參閱「瞭解效能」。

匯入資料

您可以將大量資料 (例如時間序列、遙測記錄或機器學習資料) 載入資料表,繼續探索 Bigtable。

Bigtable 支援多種資料匯入方式。舉例來說,您可以先從 Cloud Shell 中的 CSV 檔案匯入資料:

  1. 在 Google Cloud 控制台中開啟 Bigtable 執行個體清單。

    開啟執行個體清單

  2. 按一下 Bigtable 免費試用執行個體 (free-trial-instance)。

  3. 在導覽窗格中,按一下「總覽」

  4. 在「充分運用免付費執行個體」部分,選取「匯入資料」

  5. 按一下「匯入」,然後選取「透過 CLI 匯入 CSV」

  6. 使用下列任一選項匯入 CSV 資料:

    • 按照「匯入 CSV 資料」一文中的步驟,將本機 CSV 檔案上傳至 Cloud Shell。

    • 在 Cloud Shell 中建立新的範例檔案:

      建立範例 CSV 檔案並填入資料

      1. 在 Cloud Shell 中執行下列指令,建立新檔案:

        nano example-data.csv
        
      2. 將下列範例資料複製到檔案中:

        ,timestamp_start,timestamp_end,point,description
        ,timestamp,timestamp,coordinate,value
        0001, 2026-045T08:12:22.668, 2026-045T08:30:59.193, 35.403, HIGH_RES
        0002, 2026-045T08:16:06.072, 2026-045T08:17:21.548, -25.831, LOW_RES
        0003, 2026-045T08:05:29.093, 2026-045T08:40:22.250, 23.703, HIGH_RES
        0004, 2026-045T08:18:30.030, 2026-045T08:20:16.674, -5.818, LOW_RES
        0005, 2026-045T08:43:49.486, 2026-045T08:51:36.868, 42.041, HIGH_RES
        0006, 2026-045T08:17:55.572, 2026-045T08:22:32.530, 96.509, HIGH_RES
        0007, 2026-045T08:02:02.056, 2026-045T08:59:34.785, 87.653, HIGH_RES
        0008, 2026-045T08:12:50.590, 2026-045T08:43:19.412, -10.296, LOW_RES
        0009, 2026-045T08:18:29.009, 2026-045T08:47:44.556, 23.375, LOW_RES
        0010, 2026-045T08:14:26.152, 2026-045T08:37:10.951, -11.726, HIGH_RES
        0011, 2026-045T08:07:44.270, 2026-045T08:37:29.702, -55.675, HIGH_RES
        0012, 2026-045T08:17:47.771, 2026-045T08:19:23.476, 37.794, HIGH_RES
        0013, 2026-045T08:29:27.933, 2026-045T08:59:45.301, -12.718, LOW_RES
        0014, 2026-045T08:12:31.432, 2026-045T08:48:47.590, -65.408, HIGH_RES
        0015, 2026-045T08:13:15.119, 2026-045T08:37:50.639, 99.327, LOW_RES
        
      3. 按下 Ctrl+X,然後按 y 確認。

  7. 請確認要匯入資料的表格已建立,且與 CSV 資料結構相符。

    如果沒有資料表,可以建立新的資料表,與 CSV 結構相符。舉例來說,您可以在Google Cloud 控制台中執行這項操作,也可以使用 cbt 指令。

    Cloud Shell 中的下列指令會為提供的 CSV 檔案範例建立新資料表:

    cbt -project PROJECT_ID \
      -instance free-trial-instance \
      createtable TABLE_ID \
      families=timestamp_start,timestamp_end,point,description
    

    更改下列內容:

    • PROJECT_ID:Bigtable 免費試用執行個體所在的專案。
    • TABLE_ID:新資料表的 ID。例如:example-table
  8. 在 Cloud Shell 提示中執行下列指令,將資料從 CSV 檔案匯入資料表:

    cbt -project PROJECT_ID \
      -instance free-trial-instance  \
      import TABLE_ID \
       FILE_NAME
    

    更改下列內容:

    • PROJECT_ID:Bigtable 免費試用執行個體所在的專案。
    • TABLE_ID:要匯入資料的表格 ID。
    • FILE_NAME:要匯入的 CSV 檔案名稱。

    範例:

    cbt -project example-project -instance free-trial-instance import \
    example-table example-data.csv
    

如要瞭解其他將資料匯入 Bigtable 的方法,請參閱匯入及匯出資料

延長免費試用期

如果專案有有效的 Cloud Billing 帳戶,您可以將 10 天試用期延長至 90 天。

如要將免費試用期延長至 90 天,請按照下列步驟操作:

  1. 確認專案已連結有效的 Cloud Billing 帳戶。

    如果您是新 Google Cloud 客戶,請先使用 Google 帳戶登入Google Cloud 控制台,並使用信用卡或其他付款方式設定 Cloud Billing 帳戶,再建立 Bigtable 免費試用執行個體。Google 會使用這項付款資訊驗證您的身分。除非您將 Cloud Billing 帳戶升級為付費帳戶,並升級 Bigtable 免費試用執行個體,否則我們不會向您收取 Bigtable 執行個體的費用。

  2. 在 Google Cloud 控制台中開啟 Bigtable 執行個體清單。

    開啟執行個體清單

  3. 按一下 Bigtable 免費試用執行個體 (free-trial-instance)。

  4. 在導覽窗格中,按一下「總覽」

  5. 在「總覽」部分,按一下「延長試用期」

升級 Bigtable 免付費試用執行個體

升級 Bigtable 免費試用執行個體後,試用期即結束,且執行個體不再受試用功能限制。例如,您可以擴充或啟用複製功能。

下列步驟說明如何升級 Bigtable 免費試用執行個體:

  1. 在 Google Cloud 控制台中開啟 Bigtable 執行個體清單。

    開啟執行個體清單

  2. 按一下 Bigtable 免費試用執行個體 (free-trial-instance)。

  3. 在導覽窗格中,按一下「總覽」

  4. 在「總覽」部分,按一下「升級」

    「升級免付費的 Bigtable 執行個體」頁面隨即開啟,並顯示試用版功能與完整版功能的比較。

  5. 按一下「升級」

    升級執行個體後,您可以修改執行個體,設定複製、自動調度資源和其他選項。

刪除 Bigtable 免費試用執行個體

  1. 在 Google Cloud 控制台中開啟 Bigtable 執行個體清單。

    開啟執行個體清單

  2. 按一下 Bigtable 免費試用執行個體 (free-trial-instance)。

  3. 按一下 [Delete instance] (刪除執行個體)

  4. 輸入執行個體 ID,然後按一下「刪除」,確認要刪除。

疑難排解

「歡迎使用 Bigtable」頁面沒有可建立 Bigtable 免費試用執行個體的欄位
每個專案可建立一個 Bigtable 免付費試用執行個體。如果您已在專案中建立 Bigtable 免費試用執行個體,即使刪除原始執行個體,也無法再建立其他執行個體。

後續步驟