Examples and use cases
This page provides complete examples for common Apex deployment scenarios. Use these as starting points and adapt them to your environment.
Single-Node All-in-One (Local)
Section titled “Single-Node All-in-One (Local)”The simplest deployment: all components on one node using local transport.
Use case: Development, testing, or small production deployments on a single machine.
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: single-node-localspec: release: profile: all-in-one channel: stable nodes: - name: localhost transport: local host: localhost platform: linux-x64 roles: - id: tsdb component: tsdb version: auto - id: idmp component: idmp version: auto - id: tdgpt component: tdgpt version: autoDeploy:
apex deploy -f single-node-local.yaml --yesSingle Remote Node (SSH)
Section titled “Single Remote Node (SSH)”Deploy to one remote server via SSH.
Use case: Dedicated TDengine server separate from your workstation.
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: single-remote-nodespec: release: profile: all-in-one channel: stable ssh: user: root keyPath: ~/.ssh/apex-deploy port: 22 nodes: - name: tdengine-server transport: ssh host: 192.168.1.100 platform: linux-x64 roles: - id: tsdb component: tsdb version: auto - id: idmp component: idmp version: auto - id: tdgpt component: tdgpt version: autoSetup:
# Generate deployment keyssh-keygen -t ed25519 -f ~/.ssh/apex-deploy
# Deploy public keyssh-copy-id -i ~/.ssh/apex-deploy.pub root@192.168.1.100
# Check connectivityapex check -f single-remote-node.yaml
# Deployapex deploy -f single-remote-node.yaml --yesMulti-Node TSDB Cluster
Section titled “Multi-Node TSDB Cluster”Deploy TSDB across multiple nodes for high availability.
Use case: Production TSDB cluster with dedicated IDMP and TDgpt nodes.
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: multi-node-clusterspec: release: profile: TSDB-Enterprise channel: stable ssh: user: root keyPath: ~/.ssh/apex-deploy port: 22 nodes: # TSDB nodes - name: tsdb-node1 transport: ssh host: 10.0.1.101 platform: linux-x64 roles: - id: tsdb1 component: tsdb version: "3.3.5.0"
- name: tsdb-node2 transport: ssh host: 10.0.1.102 platform: linux-x64 roles: - id: tsdb2 component: tsdb version: "3.3.5.0"
- name: tsdb-node3 transport: ssh host: 10.0.1.103 platform: linux-x64 roles: - id: tsdb3 component: tsdb version: "3.3.5.0"
# IDMP node - name: idmp-node transport: ssh host: 10.0.1.110 platform: linux-x64 roles: - id: idmp component: idmp version: "1.2.3.0"
# TDgpt node - name: tdgpt-node transport: ssh host: 10.0.1.120 platform: linux-x64 roles: - id: tdgpt component: tdgpt version: "1.0.5.0"Deploy:
# Validate configurationapex validate -f multi-node-cluster.yaml --manifests ~/.apex/manifests/
# Review planapex apply -f multi-node-cluster.yaml --dry-run
# Deployapex deploy -f multi-node-cluster.yaml --yesWindows Host Deployment
Section titled “Windows Host Deployment”Deploy to Windows servers.
Use case: Windows-based infrastructure.
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: windows-deploymentspec: release: profile: all-in-one channel: stable ssh: user: Administrator keyPath: ~/.ssh/windows-deploy port: 22 nodes: - name: win-server1 transport: ssh host: 192.168.1.200 platform: windows-x64 apexDir: C:\ProgramData\TDengine\Apex roles: - id: tsdb component: tsdb version: auto - id: idmp component: idmp version: autoNotes:
- OpenSSH must be installed on Windows targets
- Use Administrator or a user with admin privileges
apexDirdefaults toC:\ProgramData\TDengine\Apexif omitted
Mixed Platform Deployment
Section titled “Mixed Platform Deployment”Deploy to both Linux and Windows nodes.
Use case: Heterogeneous infrastructure.
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: mixed-platformspec: release: profile: TSDB-Enterprise channel: stable ssh: user: root keyPath: ~/.ssh/apex-deploy nodes: - name: linux-tsdb transport: ssh host: 10.0.1.101 platform: linux-x64 roles: - id: tsdb-linux component: tsdb version: "3.3.5.0"
- name: windows-idmp transport: ssh host: 10.0.1.200 platform: windows-x64 ssh: user: Administrator keyPath: ~/.ssh/windows-deploy roles: - id: idmp-win component: idmp version: "1.2.3.0"Production with Pinned Versions
Section titled “Production with Pinned Versions”Production deployment with explicit version control.
Use case: Production environments requiring version stability.
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: production-stablespec: # No release section - all versions explicit ssh: user: deploy-user keyPath: ~/.ssh/apex-prod port: 2222 # Non-standard SSH port nodes: - name: prod-node1 transport: ssh host: prod-db01.example.com platform: linux-x64 apexDir: /opt/apex roles: - id: tsdb-prod component: tsdb version: "3.3.5.0" # Pinned version - id: idmp-prod component: idmp version: "1.2.3.0" # Pinned version - id: tdgpt-prod component: tdgpt version: "1.0.5.0" # Pinned versionBest practices:
- Pin all versions explicitly
- Use non-standard SSH port
- Use dedicated deployment user
- Set custom
apexDirif needed - Test in staging first with same versions
Development with Local and Remote Nodes
Section titled “Development with Local and Remote Nodes”Development setup mixing local and remote nodes.
Use case: Develop locally, test on remote infrastructure.
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: dev-hybridspec: release: profile: all-in-one channel: stable ssh: user: developer keyPath: ~/.ssh/dev-key nodes: # Local development TSDB - name: local-tsdb transport: local host: localhost platform: linux-x64 roles: - id: local-tsdb component: tsdb version: auto
# Remote IDMP for testing - name: remote-idmp transport: ssh host: dev-server.internal platform: linux-x64 roles: - id: remote-idmp component: idmp version: autoARM64 Deployment
Section titled “ARM64 Deployment”Deploy to ARM64 servers (e.g., AWS Graviton, Raspberry Pi clusters).
Use case: ARM-based infrastructure.
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: arm64-deploymentspec: release: profile: TSDB-Enterprise channel: stable ssh: user: ubuntu keyPath: ~/.ssh/arm-deploy nodes: - name: graviton-node1 transport: ssh host: 10.0.2.101 platform: linux-arm64 roles: - id: tsdb-arm1 component: tsdb version: auto
- name: graviton-node2 transport: ssh host: 10.0.2.102 platform: linux-arm64 roles: - id: tsdb-arm2 component: tsdb version: autoOffline Air-Gapped Deployment
Section titled “Offline Air-Gapped Deployment”Deploy in an environment without internet access.
Use case: Secure or isolated networks.
Preparation (on connected machine):
# Download Apex releasecurl -O https://downloads.tdengine.com/apex/v0.4.0/apex-linux-x64-v0.4.0.tar.gz
# Download component artifacts (after preparing on connected host)cp -r ~/.apex/cache offline-bundle/
# Transfer offline-bundle/ to air-gapped environmentDeployment YAML (on air-gapped machine):
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: airgap-deploymentspec: release: profile: all-in-one channel: stable nodes: - name: secure-node transport: local host: localhost platform: linux-x64 roles: - id: tsdb component: tsdb version: "3.3.5.0" - id: idmp component: idmp version: "1.2.3.0"Deploy:
# Install Apex from offline bundletar xzf apex-linux-x64-v0.4.0.tar.gzcd apex-linux-x64-v0.4.0./install.sh -OfflineBundle .
# Import artifactsapex prepare -f airgap-deployment.yaml \ --manifests ~/.apex/manifests/ \ --import-dir ./cache
# Deployapex apply -f airgap-deployment.yaml --yesDeployment with Custom SSH Settings
Section titled “Deployment with Custom SSH Settings”Per-node SSH configuration overrides.
Use case: Different credentials or ports per node.
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: custom-sshspec: # Global SSH defaults ssh: user: root keyPath: ~/.ssh/default-key port: 22
nodes: - name: node1 transport: ssh host: 10.0.1.101 platform: linux-x64 # Uses global SSH settings roles: - id: tsdb1 component: tsdb version: auto
- name: node2 transport: ssh host: 10.0.1.102 platform: linux-x64 # Override SSH settings for this node ssh: user: ubuntu keyPath: ~/.ssh/node2-key port: 2222 roles: - id: tsdb2 component: tsdb version: auto
- name: node3 transport: ssh host: 10.0.1.103 platform: linux-x64 # Use password auth for this node (not recommended) ssh: user: admin password: "${NODE3_PASSWORD}" roles: - id: idmp component: idmp version: autoDeploy:
export NODE3_PASSWORD="secure-password"apex deploy -f custom-ssh.yaml --yesBastion Host / Jump Server
Section titled “Bastion Host / Jump Server”Deploy through a bastion host.
Use case: Production networks requiring jump servers.
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: bastion-deploymentspec: release: profile: all-in-one channel: stable ssh: user: deploy-user keyPath: ~/.ssh/prod-key port: 22 proxyJump: bastion-user@bastion.example.com
nodes: - name: prod-db01 transport: ssh host: 10.0.1.101 # Private IP platform: linux-x64 roles: - id: tsdb component: tsdb version: "3.3.5.0" - id: idmp component: idmp version: "1.2.3.0"SSH Config (~/.ssh/config):
Host bastion.example.com User bastion-user IdentityFile ~/.ssh/bastion-key
Host 10.0.1.* ProxyJump bastion.example.com User deploy-user IdentityFile ~/.ssh/prod-keyStaged Deployment Pattern
Section titled “Staged Deployment Pattern”Deploy components in stages with validation between.
Use case: Large production deployments requiring careful orchestration.
Stage 1: Deploy TSDB only
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: stage1-tsdbspec: release: profile: TSDB-Enterprise channel: stable ssh: user: root keyPath: ~/.ssh/prod-key nodes: - name: tsdb-node1 transport: ssh host: 10.0.1.101 platform: linux-x64 roles: - id: tsdb1 component: tsdb version: "3.3.5.0"apex deploy -f stage1-tsdb.yaml --yes# Validate TSDB is workingapex-component-status.shStage 2: Add IDMP
apiVersion: tdengine.taosdata.com/v1kind: Deploymentmetadata: name: stage2-with-idmpspec: ssh: user: root keyPath: ~/.ssh/prod-key nodes: - name: tsdb-node1 transport: ssh host: 10.0.1.101 platform: linux-x64 roles: - id: tsdb1 component: tsdb version: "3.3.5.0" - id: idmp1 component: idmp version: "1.2.3.0"apex deploy -f stage2-idmp.yaml --yes# Validate IDMP connectivity to TSDBCI/CD Integration Example
Section titled “CI/CD Integration Example”Automated deployment from CI/CD pipeline.
Use case: Automated testing and deployment.
GitLab CI (.gitlab-ci.yml):
deploy-staging: stage: deploy environment: staging script: - curl -fsSL https://downloads.tdengine.com/apex/latest/install.sh | bash - apex check -f deployments/staging.yaml - apex validate -f deployments/staging.yaml --manifests ~/.apex/manifests/ - apex deploy -f deployments/staging.yaml --yes only: - develop
deploy-production: stage: deploy environment: production script: - curl -fsSL https://downloads.tdengine.com/apex/latest/install.sh | bash - apex deploy -f deployments/production.yaml --yes only: - main when: manual # Require manual approvalGitHub Actions (.github/workflows/deploy.yml):
name: Deploy TDengine
on: push: branches: [main] workflow_dispatch:
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3
- name: Install Apex run: | curl -fsSL https://downloads.tdengine.com/apex/latest/install.sh | bash echo "$HOME/.apex/bin" >> $GITHUB_PATH
- name: Setup SSH Key run: | mkdir -p ~/.ssh echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy-key chmod 600 ~/.ssh/deploy-key
- name: Deploy env: SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }} run: | apex check -f deployment.yaml apex deploy -f deployment.yaml --yesCommon Patterns
Section titled “Common Patterns”Dynamic Version with Fallback
Section titled “Dynamic Version with Fallback”Resolve versions dynamically but save for reproducibility:
# Resolve versionsapex validate -f deployment.yaml --manifests ~/.apex/manifests/ \ > deployment-resolved.yaml
# Review resolved versionscat deployment-resolved.yaml
# Deploy with resolved versionsapex prepare -f deployment-resolved.yaml --manifests ~/.apex/manifests/apex apply -f deployment-resolved.yaml --yes
# Save for rollbackcp deployment-resolved.yaml deployments/prod-$(date +%Y%m%d).yamlHealth Check After Deployment
Section titled “Health Check After Deployment”apex deploy -f deployment.yaml --yes
# Wait for services to startsleep 30
# Check component statusapex-component-status.sh
# Custom health checkscurl -f http://localhost:6041/rest/sql -u root:taosdata \ -d 'show databases'Rollback Pattern
Section titled “Rollback Pattern”# Save current deploymentcp deployment.yaml deployment-backup-$(date +%Y%m%d).yaml
# Deploy new versionapex deploy -f deployment-new.yaml --yes
# If problems occur, rollbackapex deploy -f deployment-backup-20250115.yaml --yesRelated Topics
Section titled “Related Topics”- Deployment YAML reference - Complete field reference
- Best practices - Operational guidance
- Troubleshooting - Common issues
- Security guide - Secure deployment patterns