规划 Azure 时序见解 Gen2 环境Plan your Azure Time Series Insights Gen2 environment

本文介绍有关快速规划和开始使用 Azure 时序见解第 2 代的最佳做法。This article describes best practices to plan and get started quickly by using Azure Time Series Insights Gen2.

有关计划和准备的最佳实践Best practices for planning and preparation

围绕环境规划和准备的最佳做法在以下文章中进一步进行了阐述:Best practices surrounding planning for and preparing your environment are described further in the following articles:

Azure 时序见解采用即用即付业务模型。Azure Time Series Insights employs a pay-as-you-go business model. 若要详细了解费用和容量,请阅读 Azure 时序见解定价For more information about charges and capacity, read Azure Time Series Insights pricing.

第 2 代环境The Gen2 environment

预配 Azure 时序见解第 2 代环境时,请创建两个 Azure 资源:When you provision an Azure Time Series Insights Gen2 environment, you create two Azure resources:

  • Azure 时序见解第 2 代环境An Azure Time Series Insights Gen2 environment
  • Azure 存储帐户An Azure Storage account

我们在预配过程中指定是否要启用暖存储。As part of the provisioning process, you specify whether you want to enable a warm store. 暖存储提供分层的查询体验。Warm store provides you with a tiered query experience. 启用后,必须指定 7 到 30 天的保留期。When enabled, you must specify a retention period between 7 and 30 days. 在暖存储保留期内执行的查询通常响应时间更短。Queries executed within the warm store retention period generally provide faster response times. 如果查询跨越暖存储保留期,系统会从冷存储为其提供服务。When a query spans over the warm store retention period, it's served from cold store.

在暖存储上进行的查询免费,而在冷存储上进行的查询则收费。Queries on warm store are free, while queries on cold store incur costs. 必须了解查询模式并对暖存储配置进行相应的计划。It's important to understand your query patterns and plan your warm store configuration accordingly. 建议将对最新数据进行的交互式分析驻留在暖存储中,将模式分析和长期趋势驻留在冷存储中。We recommend that interactive analytics on the most recent data reside in your warm store and pattern analysis and long-term trends reside in cold.

备注

若要详细了解如何查询暖数据,请阅读 API 参考To read more about how to query your warm data, read the API Reference.

若要开始,需要三个附加项:To start, you need three additional items:

查看 Azure 时序见解第 2 代限制Review Azure Time Series Insights Gen2 limits

属性限制Property limits

对于暖存储,Azure 时序见解属性限制已增加到 1,000,而对于冷存储,则没有属性限制。Azure Time Series Insights property limits have increased to 1,000 for warm storage and no property limit for cold storage. 提供的事件属性具有相应的 JSON、CSV 和图表列,可以在 Azure 时序见解第 2 代资源管理器中查看它们。Supplied event properties have corresponding JSON, CSV, and chart columns that you can view within the Azure Time Series Insights Gen2 Explorer.

SKUSKU 最大属性数Maximum properties
第 2 代 (L1)Gen2 (L1) 对于暖存储,限制为 1,000 个属性(列),而对于冷存储,则无限制。1,000 properties (columns) for warm storage and unlimited for cold storage
第 1 代 (S1)Gen1 (S1) 600 属性(列)600 properties (columns)
第 1 代 (S2)Gen1 (S2) 800 属性(列)800 properties (columns)

流式引入Streaming Ingestion

  • 每个环境最多只能有两个事件源There is a maximum of two event sources per environment.

  • 有关事件源的最佳做法和一般指南,可在此处找到The best practices and general guidance for event sources can be found here

  • 默认情况下,对于每个 Azure 时序见解第 2 代环境,Azure 时序见解第 2 代可按 每秒最多 1 兆字节 (MBps) 的速率引入传入的数据。By default, Azure Time Series Insights Gen2 can ingest incoming data at a rate of up to 1 megabyte per second (MBps) per Azure Time Series Insights Gen2 environment. 存在针对单个中心分区的其他限制。There are additional limitations per hub partition. 通过 Azure 门户提交支持票证最多可获得 2 MBps 的速率。Rates of up to 2 MBps can be provided by submitting a support ticket through the Azure portal. 若要了解详细信息,请参阅流式引入吞吐量限制To learn more, read Streaming Ingestion Throughput Limits.

API 限制API limits

REST API 参考文档中指定了针对 Azure 时序见解第 2 代的 REST API 限制。REST API limits for Azure Time Series Insights Gen2 are specified in the REST API reference documentation.

配置时序 ID 和时间戳属性Configure Time Series IDs and Timestamp properties

若要创建新的 Azure 时序见解环境,请选择时序 ID。To create a new Azure Time Series Insights environment, select a Time Series ID. 此操作用作数据的逻辑分区。Doing so acts as a logical partition for your data. 如前所述,请确保时序 ID 已准备就绪。As noted, make sure to have your Time Series IDs ready.

重要

时序 ID 以后不能更改。Time Series IDs can't be changed later. 在进行最终选择和首次使用之前验证每个 ID。Verify each one before final selection and first use.

可以选择最多三个键以唯一区分资源。You can select up to three keys to uniquely differentiate your resources. 有关详细信息,请阅读选择时序 ID 的最佳做法引入规则For more information, read Best practices for choosing a Time Series ID and Ingestion rules.

时间戳属性也十分重要。The Timestamp property is also important. 可以在添加事件源时指定此属性。You can designate this property when you add event sources. 每个事件源都有一个可选的时间戳属性,它用于随时间推移跟踪事件源。Each event source has an optional Timestamp property that's used to track event sources over time. 时间戳值区分大小写,并且必须按照每个事件源的单独规范设置格式。Timestamp values are case sensitive and must be formatted to the individual specification of each event source.

留空时,事件排队进入 IoT 中心或事件中心的时间将用作事件时间戳。When left blank, the time when the event was enqueued into the IoT Hub or Event Hub is used as the event Timestamp. 通常情况下,用户应选择对时间戳属性进行自定义,并使用传感器或标记生成读数时的时间,而不是使用中心排队时间。In general, users should opt to customize the Timestamp property and use the time when the sensor or tag generated the reading, rather than the hub enqueued time. 若要获取详细信息并了解时区偏移量,请参阅事件源时间戳For more information and to read about time zone offsets read Event source timestamp.

了解时序模型Understand the Time Series Model

现在可以配置 Azure 时序见解环境的时序模型。You can now configure your Azure Time Series Insights environment's Time Series Model. 通过新模型可以轻松查找和分析 IoT 数据。The new model makes it easy to find and analyze IoT data. 它可实现时序数据的特选、维护和扩充,并可帮助准备供使用者使用的数据集。It enables the curation, maintenance, and enrichment of time series data and helps to prepare consumer-ready data sets. 模型使用时序 ID,这些 ID 映射到将唯一资源与变量(称为类型)和层次结构关联的实例。The model uses Time Series IDs, which map to an instance that associates the unique resource with variables, known as types, and hierarchies. 请阅读时序模型概述以了解详情。Read about the Time Series Model overview to learn more.

模型是动态的,因此可以随时生成。The model is dynamic, so it can be built at any time. 若要快速开始,请先生成并上传它,然后再将数据推送到 Azure 时序见解。To get started quickly, build and upload it prior to pushing data into Azure Time Series Insights. 若要生成模型,请阅读使用时序模型To build your model, read Use the Time Series Model.

对于许多客户而言,时序模型映射到已实施的现有资产模型或 ERP 系统。For many customers, the Time Series Model maps to an existing asset model or ERP system already in place. 如果没有现有模型,则提供了预生成用户体验以快速启动并运行。If you don't have an existing model, a prebuilt user experience is provided to get up and running quickly. 若要了解模型可如何帮助你,请查看示例演示环境To envision how a model might help you, view the sample demo environment.

塑造事件Shape your events

可以验证将事件发送到 Azure 时序见解的方法。You can verify the way that you send events to Azure Time Series Insights. 理想情况下,事件非规范化且高效。Ideally, your events are denormalized well and efficiently.

一个好的经验法则是:A good rule of thumb:

  • 将元数据存储在时序模型中。Store metadata in your Time Series Model.
  • 确保时序模式、实例字段和事件仅包括必要信息,例如:时序 ID 或时间戳属性。Ensure that Time Series Mode, instance fields, and events include only necessary information, such as a Time Series ID or Timestamp property.

若要获取详细信息并了解如何平展和存储事件,请阅读 JSON 平展和转义规则For more information and to understand how events will be flattened and stored, read the JSON flattening and escaping rules.

业务灾难恢复Business disaster recovery

本部分介绍即使发生了灾难,也能使应用和服务保持正常运行的 Azure 时序见解功能(称为“业务灾难恢复”)。 This section describes features of Azure Time Series Insights that keep apps and services running, even if a disaster occurs (known as business disaster recovery).

高可用性High availability

作为一项 Azure 服务,Azure 时序见解使用 Azure 区域级别的冗余提供某些高可用性功能。As an Azure service, Azure Time Series Insights provides certain high availability features by using redundancies at the Azure region level. 例如,Azure 支持通过其跨区域可用性功能来实现 灾难恢复功能。 For example, Azure supports disaster recovery capabilities through Azure's cross-region availability feature.

通过 Azure 提供的其他高可用性功能(以及同样适用于任何 Azure 时序见解实例的功能)包括:Additional high-availability features provided through Azure (and also available to any Azure Time Series Insights instance) include:

  • Azure Site Recovery:Azure 通过 Azure Site Recovery 提供恢复功能。Azure Site Recovery: Azure provides recovery features through Azure Site Recovery.
  • Azure 备份Azure 备份支持 Azure VM 的本地和云中备份。Azure Backup: Azure Backup supports both on-premises and in-cloud backup of Azure VMs.

请务必启用相关的 Azure 功能,以便为设备和用户提供全局跨区域高可用性。Make sure you enable the relevant Azure features to provide global, cross-region high availability for your devices and users.

备注

如果已将 Azure 配置为启用跨区域可用性,则不需要在 Azure 时序见解中采用其他跨区域可用性配置。If Azure is configured to enable cross-region availability, no additional cross-region availability configuration is required in Azure Time Series Insights.

IoT 和事件中心IoT and event hubs

某些 Azure IoT 服务也包含内置的业务灾难恢复功能:Some Azure IoT services also include built-in business disaster recovery features:

将 Azure 时序见解与其他服务集成有可能会提供更多的灾难恢复机制。Integrating Azure Time Series Insights with the other services provides additional disaster recovery opportunities. 例如,可将发送到事件中心的遥测数据保留在 Azure Blob 存储备份数据库中。For example, telemetry sent to your event hub might be persisted to a backup Azure Blob storage database.

Azure 时序见解Azure Time Series Insights

可通过多种方式使 Azure 时序见解数据、应用和服务保持正常运行,即使发生中断。There are several ways to keep your Azure Time Series Insights data, apps, and services running, even if they're disrupted.

但是,还可以确定是否需要出于以下目的,来创建 Azure 时序环境的完整备份副本:However, you might determine that a complete backup copy of your Azure Time Series environment also is required, for the following purposes:

  • Azure 时序见解专门将数据和流量重定向到某个故障转移实例As a failover instance specifically for Azure Time Series Insights to redirect data and traffic to
  • 保留数据和审核信息To preserve data and auditing information

一般而言,复制 Azure 时序见解环境的最佳方法是在备份 Azure 区域中创建另一个 Azure 时序见解环境。In general, the best way to duplicate an Azure Time Series Insights environment is to create a second Azure Time Series Insights environment in a backup Azure region. 来自主要事件源的事件也会发送到此辅助环境。Events are also sent to this secondary environment from your primary event source. 请务必使用另一个专用使用者组。Make sure that you use a second dedicated consumer group. 遵循前面所述的源业务灾难恢复指导原则。Follow that source's business disaster recovery guidelines, as described earlier.

若要创建副本环境:To create a duplicate environment:

  1. 在另一个区域中创建环境。Create an environment in a second region. 有关详细信息,请参阅在 Azure 门户中创建新的 Azure 时序见解环境For more information, read Create a new Azure Time Series Insights environment in the Azure portal.
  2. 为事件源创建另一个专用使用者组。Create a second dedicated consumer group for your event source.
  3. 将该事件源连接到新环境。Connect that event source to the new environment. 请务必指定第二个专用使用者组。Make sure that you designate the second dedicated consumer group.
  4. 请查看 Azure 时序见解 IoT 中心事件中心文档。Review the Azure Time Series Insights IoT Hub and Event Hubs documentation.

发生事件时:If an event occurs:

  1. 如果主要区域在灾难事件期间受到影响,请将操作重新路由到备用 Azure 时序见解环境。If your primary region is affected during a disaster incident, reroute operations to the backup Azure Time Series Insights environment.
  2. 由于中心序列号在故障转移后重新归零,请在具有不同使用者组的区域/环境中重新创建事件源,以避免创建类似重复事件的内容。Because hub sequence numbers restart from 0 after the failover, recreate the event source in both regions/environments with different consumer groups to avoid creating what would look like duplicate events.
  3. 使用第二个区域来备份和恢复所有 Azure 时序见解遥测数据与查询数据。Use your second region to back up and recover all Azure Time Series Insights telemetry and query data.

重要

发生故障转移时:If a failover occurs:

  • 也可能会发生延迟。A delay might also occur.
  • 由于需要重新路由操作,还可能会出现短暂的消息处理高峰。A momentary spike in message processing might occur, as operations are rerouted.

有关详细信息,请参阅缓解 Azure 时序见解中的延迟For more information, read Mitigate latency in Azure Time Series Insights.

后续步骤Next steps

  • 若要规划业务恢复配置选项,请查看 Azure 顾问Review Azure Advisor to plan out your business recovery configuration options.
  • 若要规划业务恢复配置选项,请查看 Azure 顾问Review Azure Advisor to plan out your business recovery configuration options.
  • 阅读有关 Azure 时序见解第 2 代中数据引入的详细信息。Read more about data ingestion in Azure Time Series Insights Gen2.
  • 查看有关 Azure 时序见解第 2 代中数据存储的文章。Review the article on data storage in Azure Time Series Insights Gen2.
  • 了解 Azure 时序见解第 2 代中的数据建模Learn about data modeling in Azure Time Series Insights Gen2.