创建免费试用实例并导入示例数据

本 Bigtable 免费试用实例快速入门指南将引导您完成设置 Bigtable 免费试用实例和探索 Bigtable 功能的初始步骤。

借助 Bigtable 免费试用实例,您可以在 90 天内免费了解和探索 Bigtable 的特性和功能。如需详细了解 Bigtable 免费试用和 Bigtable 免费试用实例,请参阅 免费试用概览

在本快速入门中,您将执行以下操作:

  • 在 Google Cloud 控制台中创建 Bigtable 免费试用实例。
  • 使用 Bigtable Studio 对示例数据运行查询。
  • 导入 100 GB 的示例数据以进行性能测试。
  • 使用 Cloud Shell 将您自己的数据导入 Bigtable 免费试用实例。

准备工作

  • 任何拥有 Google 账号的用户都可以享受 10 天的试用期。
  • 如果在包含 Bigtable 免费试用实例的项目中启用了 Cloud Billing,则 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 控制台中打开欢迎使用 Bigtable 页面。

    欢迎使用 Bigtable

  2. 免费体验 Bigtable,无需任何承诺 部分中,输入以下内容:

    1. 实例名称部分,输入实例的名称。例如,Free trial instance
    2. (可选)在实例 ID 部分,查看自动生成的实例 标识符,并根据需要进行更改。本指南中的示例使用 free-trial-instance ID。
    3. 区域 部分,选择您附近的一个区域。
    4. 可用区 部分,选择任何
  3. 点击创建免费实例

了解 Bigtable 基础知识

控制台中的 Bigtable 免费试用实例界面提供了一个可选的互动式教程,该教程将引导您了解和试用 Bigtable 基础知识。 Google Cloud

您还可以选择在 Bigtable 免费试用实例的概览中观看这段 4 分钟的简介视频:

  1. 在 Google Cloud 控制台中打开 Bigtable 实例列表。

    打开实例列表

  2. 点击您的 Bigtable 免费试用实例 (free-trial-instance)。

  3. 在导航窗格中,点击概览

  4. 充分利用免费实例 部分中,选择 Bigtable 基础知识 ,然后点击播放视频

  5. 如需完成本教程步骤,请点击标记为已完成

查询示例数据

在控制台中创建 Bigtable 免费试用实例时,Bigtable 会为您创建一个示例表和示例查询,以便您探索和熟悉 Bigtable 的特性和功能。Google Cloud

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. 探索器 窗格中,展开查询

  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. 如需完成本教程步骤,请返回概览 ,然后点击标记为已完成

如需深入了解,您可以按照 PerfKitBenchmarker 教程 for Bigtable 创建针对特定用例量身定制的自定义测试。如需详细了解性能测试,请参阅了解性能

导入数据

您可以将大量数据(例如时序数据、遥测日志或机器学习数据)加载到表中,继续探索 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. 点击删除实例

  4. 输入实例 ID,然后点击删除 以确认删除。

问题排查

欢迎使用 Bigtable 页面没有用于创建 Bigtable 免费试用实例的字段
您可以在每个项目中创建一个 Bigtable 免费试用实例。如果您已在项目中创建了 Bigtable 免费试用实例,则无法再创建其他实例,即使您删除了原始实例也是如此。

后续步骤