在 Timestream for InfluxDB 3 中建立叢集 - Amazon Timestream

如需類似 Amazon Timestream for LiveAnalytics 的功能,請考慮使用 Amazon Timestream for InfluxDB。它提供簡化的資料擷取和單一位數毫秒查詢回應時間,以進行即時分析。在這裡進一步了解。

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

在 Timestream for InfluxDB 3 中建立叢集

在 Amazon Timestream 中建立新的 InfluxDB 3 叢集需要選取適當的版本、部署模型和組態設定,以符合您的工作負載需求。

使用 AWS 管理主控台

  1. 登入 AWS 管理主控台 並開啟 Timestream for InfluxDB 主控台。

  2. 在導覽窗格中,選擇 InfluxDB 資料庫

  3. 選擇建立 InfluxDB 資料庫

  4. 針對引擎版本,選擇 InfluxDB 3 做為您的引擎版本

  5. 對於版本

    • 選擇核心以開發、測試或近乎即時地監控最近資料。

    • 針對需要高可用性、長期儲存和壓縮的生產工作負載,選擇 Enterprise

  6. 設定部署 (根據選取的版本)。

    • 針對 Core Edition:

      • 自動設定為單一節點部署

      • 不需要額外的節點組態

    • 針對 Enterprise Edition:

      • 選擇部署組態:

        • 單一節點:一個節點處理寫入器、讀取器和壓縮器角色

        • 3 節點叢集:2 個寫入器/讀取器節點 + 1 個專用精簡器節點

        注意

        未來版本將透過參數群組更新提供超過 3 個節點的多節點組態

  7. 設定叢集設定

    • 資料庫叢集識別符:輸入叢集的唯一名稱。

    • 資料庫執行個體類別:從db.influx執行個體類別中選取 (適用於所有節點)。

    • 參數群組

      • 選取服務定義的參數群組:

        • InfluxDBv3Core (適用於核心單一節點)

        • InfluxDBv3Enterprise (適用於 Enterprise 3 節點)

        • InfluxDBv3Enterprise1Node (適用於企業單一節點)

      • 或建立/選取自訂參數群組

  8. 進行網路設定

    • 虛擬私有雲端 (VPC):選取您的 VPC。

    • 資料庫子網路群組:跨可用區域選擇子網路。

    • VPC 安全群組:選取安全群組以進行網路存取控制。

    • 公有可存取性:

      • :可從網際網路存取叢集 (使用適當的安全群組規則)。

      • :叢集只能在 VPC 內存取。

  9. (選用) 設定其他設定 

    • 標籤:新增組織和帳單的中繼資料標籤。

  10. Review and create (檢閱和建立)

    • 檢閱所有組態設定。

    • 選擇建立 InfluxDB 資料庫

叢集建立程序通常需要 10-20 分鐘。主控台會將狀態顯示為「建立」,並在就緒時變更為「可用」。

使用 AWS CLI

建立 InfluxDB 3 核心叢集:

aws timestream-influxdb create-db-cluster \ --region us-east-1 \ --name "my-influxdb3-core-cluster" \ --db-parameter-group-identifier "InfluxDBv3Core" \ --db-instance-type db.influx.large \ --vpc-subnet-ids subnet-12345abc subnet-67890def \ --vpc-security-group-ids sg-12345abc \ --publicly-accessible false

建立 InfluxDB 3 Enterprise 叢集 (3 節點):

aws timestream-influxdb create-db-cluster \ --region us-east-1 \ --name "my-influxdb3-enterprise-cluster" \ --db-parameter-group-identifier "InfluxDBv3Enterprise" \ --db-instance-type db.influx.xlarge \ --vpc-subnet-ids subnet-12345abc subnet-67890def \ --vpc-security-group-ids sg-12345abc \ --publicly-accessible false \ --log-delivery-configuration '{ "s3Configuration": { "bucketName": "my-influxdb-logs", "enabled": true } }'

建立 InfluxDB 3 Enterprise 叢集 (單一節點):

aws timestream-influxdb create-db-cluster \ --region us-east-1 \ --name "my-influxdb3-enterprise-single" \ --db-parameter-group-identifier "InfluxDBv3Enterprise1Node" \ --db-instance-type db.influx.large \ --vpc-subnet-ids subnet-12345abc subnet-67890def \ --vpc-security-group-ids sg-12345abc \ --publicly-accessible false

使用自訂參數群組建立叢集:

# First, create a custom parameter group aws timestream-influxdb create-db-parameter-group \ --name "custom-enterprise-pg" \ --engine-type "InfluxDBv3Enterprise" \ --parameters '{ "InfluxDBv3Enterprise": { "ingestQueryInstances": 2, "queryOnlyInstances": 0, "dedicatedCompactor": true, "bufferMemLimitMb": 32768, "dataFusionNumThreads": 64 } }' # Then create the cluster using the custom parameter group aws timestream-influxdb create-db-cluster \ --region us-east-1 \ --name "my-custom-enterprise-cluster" \ --db-parameter-group-identifier "custom-enterprise-pg" \ --db-instance-type db.influx.2xlarge \ --vpc-subnet-ids subnet-12345abc subnet-67890def \ --vpc-security-group-ids sg-12345abc

建立後步驟

建立叢集並可用之後:

  1. 擷取端點:

    aws timestream-influxdb get-db-cluster --identifier "my-influxdb3-cluster-id"
  2. 取得您的運算子字符:

    • 您的運算子字符會存放在您 AWS Secrets Manager 帳戶中的秘密中。秘密的名稱與您新建立的叢集識別符相同。

  3. (選用) Access InfluxDB Explorer:

    • https://docs.influxdata.com/influxdb3/explorer/:// 下載 InfluxDB Explorer。

    • 對於公有叢集:從任何可存取網際網路的位置執行 Explorer。

    • 對於私有叢集:從相同 VPC 內 (使用 EC2 執行個體、堡壘主機或透過 VPN 連接) 執行 Explorer。

  4. 驗證連線:

    influxdb3 query \ --host "your-cluster-endpoint:8086" \ --database "my-database" \ --token "my-token" \ "SHOW TABLES"

請參閱 InfluxDB 3 文件,以尋找有關寫入資料執行查詢程式管理 influxDB 3 資料庫的資訊。

重要考量事項:

  • 版本選擇:核心適用於開發和短期資料;具有長期儲存需求的生產工作負載需要企業。

  • 節點組態:叢集中的所有節點共用相同的執行個體類別和網路組態。

  • 參數群組:建立後就無法變更;變更需要建立新的參數群組。

  • 擴展:初始版本支援 1 節點和 3 節點組態;未來的更新將啟用額外的擴展選項。在初始版本中,您無法在建立之後變更節點計數。

  • 高可用性:3 節點企業組態可提供更好的容錯能力和效能分佈。

  • 壓縮:企業版的壓縮功能對於隨著時間維持效能至關重要。