创建免费试用实例并导入示例数据
本 Bigtable 免费试用实例快速入门指南将引导您完成设置 Bigtable 免费试用实例并探索 Bigtable 功能的初始步骤。
借助 Bigtable 免费试用实例,您可以在 90 天内免费了解和探索 Bigtable 的特性和功能。如需详细了解 Bigtable 免费试用和 Bigtable 免费试用实例,请参阅免费试用概览。
在本快速入门中,您将执行以下操作:
- 在 Google Cloud 控制台中创建 Bigtable 免费试用实例。
- 使用 Bigtable Studio 对示例数据运行查询。
- 导入 100 GB 的示例数据以进行性能测试。
- 使用 Cloud Shell 将您自己的数据导入到 Bigtable 免费试用版实例中。
准备工作
- 拥有 Google 账号的任何用户都可以享受 10 天的试用期。
- 如果启用了 Cloud Billing 的项目包含 Bigtable 免费试用实例,则 10 天的试用期可以延长至 90 天。 除非您选择将 Bigtable 免费试用实例升级为付费实例,否则无需支付费用。
- 如果您删除 Bigtable 免费试用实例,将无法再次创建其他实例,即使 90 天的试用期仍在有效期限内也是如此。
- 启用 API 并分配 IAM 角色:
- 登录您的 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.
Enable the Cloud Bigtable and Cloud Bigtable Admin APIs.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
Make sure that you have the following role or roles on the project: roles/bigtable.admin
Check 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.
Enable the Cloud Bigtable and Cloud Bigtable Admin APIs.
Roles required to enable APIs
To enable APIs, you need the
serviceusage.services.enablepermission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.-
Make sure that you have the following role or roles on the project: roles/bigtable.admin
Check 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.
-
创建 Bigtable 免费试用实例
以下步骤介绍了如何使用 Google Cloud 控制台创建 Bigtable 免费试用实例。
在 Google Cloud 控制台中打开欢迎使用 Bigtable 页面。
在免费体验 Bigtable,无需任何承诺部分中,输入以下内容:
- 在实例名称部分,输入实例的名称。例如
Free trial instance。 - (可选)在实例 ID 中,查看自动生成的实例标识符,并根据需要进行更改。本指南中的示例使用
free-trial-instance形式的 ID。 - 在区域部分,选择您附近的一个区域。
- 在可用区部分,选择任何。
- 在实例名称部分,输入实例的名称。例如
点击创建免费实例。
了解 Bigtable 基础知识
Google Cloud 控制台中的 Bigtable 免费试用实例界面提供了一个可选的互动式教程,可引导您学习和试用 Bigtable 基础知识。
您也可以在 Bigtable 免费试用实例的概览中观看这段 4 分钟的介绍性视频:
在 Google Cloud 控制台中,打开 Bigtable 实例列表。
点击您的 Bigtable 免费试用实例 (
free-trial-instance)。在导航窗格中,点击概览。
在充分利用免费实例部分中,选择 Bigtable 基础知识,然后点击播放视频。
如需完成本教程中的这一步,请点击标记为已完成。
查询示例数据
当您在Google Cloud 控制台中创建 Bigtable 免费试用实例时,Bigtable 会为您创建一个示例表和一些示例查询,以便您探索和熟悉 Bigtable 的功能和特性。
weather-data 表包含世界各地机场报告的示例天气数据。如需在 Bigtable Studio 中对此表运行示例查询,请执行以下操作:
在 Google Cloud 控制台中,打开 Bigtable 实例列表。
点击您的 Bigtable 免费试用实例 (
free-trial-instance)。在导航窗格中,点击概览。
在充分利用免费实例部分中,选择查询表格,然后点击查询表格。
简短的欢迎导览会介绍 Bigtable Studio 中 SQL 查询的基础知识。
以下针对示例数据的查询是在 Bigtable Studio 中创建的:
SELECT * FROM `weather-data`(WITH_HISTORY=>FALSE) LIMIT 10;点击运行。查询结果会显示在结果表中。
如需完成本教程步骤,请返回概览,然后点击标记为完成。
探索查询示例
您的免费实例中包含更多示例查询,可供您探索。您可以在查询部分中查看这些查询。
在 Google Cloud 控制台中,打开 Bigtable 实例列表。
点击您的 Bigtable 免费试用实例 (
free-trial-instance)。在导航窗格中,点击 Bigtable Studio。
在探索器窗格中,展开查询。
探索演示 Bigtable 查询不同方面的查询示例。
如需详细了解查询语法,请参阅 GoogleSQL for Bigtable 概览。
导入测试表以进行性能基准测试
如需探索 Bigtable 在处理大量数据时的功能,您可以导入一个测试表,以便运行真实的性能基准测试并探索监控工具。测试表包含 100 GB 的样本数据,这些数据基于 Yahoo! Cloud Serving Benchmark (YCSB) 测试。
如需导入用于性能测试的表格,请执行以下操作:
在 Google Cloud 控制台中,打开 Bigtable 实例列表。
点击您的 Bigtable 免费试用实例 (
free-trial-instance)。在导航窗格中,点击概览。
在充分利用免费实例部分中,选择 Bigtable 性能,然后点击导入 YCSB 数据,等待系统创建表。
点击导航窗格中的表格,然后点击
YCSB表格。在 YCSB 表中填充数据后,您可以在 Bigtable Studio 中运行查询。
如需完成本教程步骤,请返回概览,然后点击标记为完成。
如需进行更深入的探索,您可以按照 Bigtable 的 PerfKitBenchmarker 教程,根据自身特定的应用场景创建自定义测试。如需详细了解性能测试,请参阅了解性能。
导入数据
您可以将大量数据(例如时序数据、遥测日志或机器学习数据)加载到表中,继续探索 Bigtable。
Bigtable 支持多种数据导入方式。例如,您可以先从 Cloud Shell 中的 CSV 文件导入数据:
在 Google Cloud 控制台中,打开 Bigtable 实例列表。
点击您的 Bigtable 免费试用实例 (
free-trial-instance)。在导航窗格中,点击概览。
在充分利用您的免费实例部分,选择导入数据。
点击导入,然后选择通过 CLI 导入 CSV。
使用以下任一选项导入 CSV 数据:
按照导入 CSV 数据中所述的步骤将本地 CSV 文件上传到 Cloud Shell。
在 Cloud Shell 中创建新的示例文件:
创建示例 CSV 文件并填充数据
在 Cloud Shell 中运行以下命令以创建新文件:
nano example-data.csv将以下示例数据复制到文件中:
,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按 Ctrl+X,然后按 y 确认。
确保您要将数据导入到的表已创建,并且与 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。
在 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 天,请执行以下操作:
确保您的项目具有有效的 Cloud Billing 账号。
如果您是 Google Cloud 新客户,请先使用您的 Google 账号登录Google Cloud 控制台,然后使用信用卡或其他支付方式设置 Cloud Billing 账号,最后再创建 Bigtable 免费试用实例。Google 会利用这些支付信息验证您的身份。除非您明确将 Cloud Billing 账号升级为付费账号,并且将 Bigtable 免费试用实例升级为付费实例,否则我们不会向您的 Bigtable 实例收费。
在 Google Cloud 控制台中,打开 Bigtable 实例列表。
点击您的 Bigtable 免费试用实例 (
free-trial-instance)。在导航窗格中,点击概览。
在概览部分中,点击延长试用期。
升级 Bigtable 免费试用实例
升级 Bigtable 免费试用实例后,试用期即告结束,试用功能限制不再适用于您的实例。例如,您可以对其进行扩缩或启用复制。
以下步骤介绍了如何升级 Bigtable 免费试用实例:
在 Google Cloud 控制台中,打开 Bigtable 实例列表。
点击您的 Bigtable 免费试用实例 (
free-trial-instance)。在导航窗格中,点击概览。
在概览部分中,点击升级。
系统会打开升级您的 Bigtable 免费实例页面,其中会显示试用功能与完整功能的比较。
点击升级。
升级实例后,您可以修改实例以配置复制、自动扩缩和其他选项。
删除 Bigtable 免费试用实例
在 Google Cloud 控制台中,打开 Bigtable 实例列表。
点击您的 Bigtable 免费试用实例 (
free-trial-instance)。点击删除实例。
输入实例 ID 以确认删除,然后点击删除。
问题排查
- 欢迎使用 Bigtable 页面上没有用于创建 Bigtable 免费试用实例的字段
- 您可以为每个项目创建一个 Bigtable 免费试用实例。如果您已在项目中创建 Bigtable 免费试用实例,则无法再创建其他实例,即使您删除了原始实例也是如此。
后续步骤
- 详细了解 Bigtable 免费试用实例。
- 详细了解 Bigtable 实例、集群和节点。
- 详细了解如何修改实例。
- 如需详细了解免费试用期结束后 Bigtable 的价格,请参阅价格页面。