GBase Database Deployment Configuration: Understanding Three Topologies Through gbase.yml

本文为原文前 6,000 字符的节选翻译,完整内容请查看原文。

GBase Database (GBase 8c) uses a single YAML configuration file, gbase.yml, as the input for cluster deployment. The three official deployment layouts share the same basic structure but differ in how high-availability components, coordinators, and data nodes are defined. Once you understand how these YAML sections map to the cluster architecture, configuring a deployment becomes much more predictable. Instead of copying an existing configuration and deleting fields, you can select the correct topology and describe it explicitly. This tutorial compares the three layouts and explains the key differences in their gbase.yml configurations.

GBase 数据库 (GBase 8c) 使用单个 YAML 配置文件 gbase.yml 作为集群部署的输入。三种官方部署布局共享相同的基本结构,但在高可用组件、协调节点 (Coordinator) 和数据节点 (Data Node) 的定义上有所不同。一旦理解了这些 YAML 部分如何映射到集群架构,配置部署就会变得更加可预测。与其复制现有配置并删除字段,不如选择正确的拓扑并明确描述它。本教程比较了这三种布局,并解释了它们在 gbase.yml 配置中的关键差异。

  1. Start With the Shared YAML Structure All three deployment layouts use the same six top-level sections:
  • gha_server
  • dcs
  • gtm
  • coordinator
  • datanode
  • env

The environment section also follows a common structure: env: cluster_type: multiple-nodes pkg_path: /home/gbase/gbase_package prefix: /home/gbase/gbase_db version: V6_S1.0.0_B20 user: gbase port: 22 third_ssh: false

These settings define the cluster type, installation package location, installation directory, software version, deployment user, SSH port, and SSH configuration. The important distinction is that the shared skeleton does not mean the three deployments have identical component layouts.

  1. 从共享的 YAML 结构开始 所有三种部署布局都使用相同的六个顶级部分:
  • gha_server
  • dcs
  • gtm
  • coordinator
  • datanode
  • env

环境部分也遵循通用结构: env: cluster_type: multiple-nodes pkg_path: /home/gbase/gbase_package prefix: /home/gbase/gbase_db version: V6_S1.0.0_B20 user: gbase port: 22 third_ssh: false

这些设置定义了集群类型、安装包位置、安装目录、软件版本、部署用户、SSH 端口和 SSH 配置。重要的区别在于,共享的骨架并不意味着三种部署具有相同的组件布局。

  1. Compare the Three GBase Database Deployment Layouts The main structural differences are concentrated in three areas:
ComponentMinimal layoutSingle-HA-group layoutDefault distributed layout
gha_server instances121
Coordinator instances132
DN groups112
DN instances136

The most important difference is the datanode section. It determines how data nodes are grouped, how instances are assigned primary or standby roles, and how the cluster’s data topology is organized.

  1. 比较三种 GBase 数据库部署布局 主要的结构差异集中在三个方面:
组件最小化布局单高可用组布局默认分布式布局
gha_server 实例121
Coordinator 实例132
DN 组112
DN 实例136

最重要的区别在于 datanode 部分。它决定了数据节点如何分组、实例如何分配主备角色,以及集群的数据拓扑如何组织。

Layout 1: Minimal Single-Node Deployment The minimal layout contains one DN group with one primary instance. datanode:

  • dn1:
    • dn1_1: { role: primary, port: 15432 }

This is the simplest topology and is suitable for initial deployment and functional validation. There is only one data node instance, so this configuration does not provide data-node redundancy.

布局 1:最小化单节点部署 最小化布局包含一个 DN 组,其中有一个主实例。 datanode:

  • dn1:
    • dn1_1: { role: primary, port: 15432 }

这是最简单的拓扑,适用于初始部署和功能验证。由于只有一个数据节点实例,因此该配置不提供数据节点冗余。

Layout 2: Single-HA-Group Deployment The single-HA-group layout keeps one DN group but introduces three instances:

  • One primary.
  • Two standby instances.
  • Three availability-zone assignments.

datanode:

  • dn1:
    • dn1_1: { role: primary, port: 15432, az: ‘az1’ }
    • dn1_2: { role: standby, port: 15432, az: ‘az1’ }
    • dn1_3: { role: standby, port: 15432, az: ‘az2’ }

The key difference is that all three instances belong to dn1. The role field distinguishes primary and standby instances, while az identifies their availability-zone placement. This layout introduces high availability without changing the number of DN groups.

布局 2:单高可用组部署 单高可用组布局保留一个 DN 组,但引入了三个实例:

  • 一个主实例。
  • 两个备用实例。
  • 三个可用区分配。

datanode:

  • dn1:
    • dn1_1: { role: primary, port: 15432, az: ‘az1’ }
    • dn1_2: { role: standby, port: 15432, az: ‘az1’ }
    • dn1_3: { role: standby, port: 15432, az: ‘az2’ }

关键区别在于所有三个实例都属于 dn1。role 字段区分主备实例,而 az 标识它们的可用区位置。此布局在不改变 DN 组数量的情况下引入了高可用性。

Layout 3: Default Distributed Deployment The default distributed layout introduces two DN groups, each containing three instances.

datanode:

  • dn1:
    • dn1_1: { role: primary, port: 15432 }
    • dn1_2: { role: standby, port: 15433 }
    • dn1_3: { role: standby, port: 15433 }
  • dn2:
    • dn2_1: { role: primary, port: 20010 }
    • dn2_2: { role: standby, port: 20010 }
    • dn2_3: { role: standby, port: 20010 }

There are six DN instances in total: dn1 contains one primary and two standby instances; dn2 contains one primary and two standby instances. Notice two important differences from the single-HA-group example. First, the official distributed example does not declare az. Second, it does not declare proxy_port. These differences matter when selecting the correct configuration template. Do not assume that fields from one topology can be copied into another without checking the corresponding deployment specification.

布局 3:默认分布式部署 默认分布式布局引入了两个 DN 组,每个组包含三个实例。

datanode:

  • dn1:
    • dn1_1: { role: primary, port: 15432 }
    • dn1_2: { role: standby, port: 15433 }
    • dn1_3: { role: standby, port: 15433 }
  • dn2:
    • dn2_1: { role: primary, port: 20010 }
    • dn2_2: { role: standby, port: 20010 }
    • dn2_3: { role: standby, port: 20010 }

总共有六个 DN 实例:dn1 包含一个主实例和两个备用实例;dn2 包含一个主实例和两个备用实例。请注意与单高可用组示例的两个重要区别。首先,官方分布式示例没有声明 az。其次,它没有声明 proxy_port。在选择正确的配置模板时,这些差异非常重要。不要假设可以随意从一个拓扑复制字段到另一个拓扑,而不检查相应的部署规范。

  1. Understand the Difference Between DN Groups and DN Instances This is the most important concept when reading gbase.yml. A DN group is not the same as a DN instance. For example:

datanode:

  • dn1:
    • dn1_1: { role: primary, port: 15432 }
    • dn1_2: { role: standby, port: 15433 }
    • dn1_3: { role: standby, port: 15433 }

Here, dn1 represents one DN group, while dn1_1, dn1_2, and dn1_3 represent its three instances. Adding another instance to an existing group and introducing another DN group are different topology operations. This distinction is essential for GBase Database capacity planning and future cluster expansion.

  1. 理解 DN 组与 DN 实例的区别 这是阅读 gbase.yml 时最重要的概念。DN 组与 DN 实例并不相同。例如:

datanode:

  • dn1:
    • dn1_1: { role: primary, port: 15432 }
    • dn1_2: { role: standby, port: 15433 }
    • dn1_3: { role: standby, port: 15433 }

在这里,dn1 代表一个 DN 组,而 dn1_1、dn1_2 和 dn1_3 代表其三个实例。向现有组添加另一个实例与引入另一个 DN 组是不同的拓扑操作。这种区别对于 GBase 数据库的容量规划和未来的集群扩展至关重要。

  1. Run the Pre-installation and Deployment Commands in Order After editing gbase.yml, follow the deployment sequence. First, perform the SSH and user preparation checks: cd /home/gbase/gbase_package/script/ ./gha_preinstall -s
    —root-passwd=""
    —set-user-passwd="
    "
    -f /home/gbase/gbase.yml

Next, run the comprehensive environment checks: ./gha_preinstall -i A
-f /home/gbase/gbase.yml

Then execute the environment configuration and repair stage: ./gha_preinstall -i B
-f /home/gbase/gbase.yml

Finally, install the cluster: ./gha_ctl install -p /home/gbase/ -c gbase

Each stage has a different purpose:

  • -s prepares SSH access and user configuration.
  • -i A performs the comprehensive pre-installation checks.
  • -i B executes the supported automatic environment adjustments.
  • gha_ctl install starts the cluster installation process.

Do not treat these commands as interchangeable. Complete the required checks and configuration steps before starting installation.

  1. 按顺序运行预安装和部署命令 编辑 gbase.yml 后,请遵循部署顺序。首先,执行 SSH 和用户准备检查: cd /home/gbase/gbase_package/script/ ./gha_preinstall -s
    —root-passwd=""
    —set-user-passwd="
    "
    -f /home/gbase/gbase.yml

接下来,运行全面的环境检查: ./gha_preinstall -i A
-f /home/gbase/gbase.yml

然后执行环境配置和修复阶段: ./gha_preinstall -i B
-f /home/gbase/gbase.yml

最后,安装集群: ./gha_ctl install -p /home/gbase/ -c gbase

每个阶段都有不同的目的:

  • -s 准备 SSH 访问和用户配置。
  • -i A 执行全面的预安装检查。
  • -i B 执行支持的自动环境调整。
  • gha_ctl install 启动集群安装过程。

不要将这些命令视为可互换的。在开始安装之前,请完成所需的检查和配置步骤。

  1. Two Configuration Details That Are Easy to Miss Detail 1: Do Not Mix Fields Between Deployment Templates The default distributed example does not contain proxy_port or az. Avoid copying another topology and deleting fields based on assumptions. Additional fields are not guaranteed to be ignored by the configuration parser or deployment process. Start with the official example matching your target architecture, then modify the values required by your environment.

Detail 2: Assign host and agent_host According to the Network Design The host and agent_host fields must reflect the actual dual-NIC network plan. In the deployment design described here:

  • host corresponds to the data-plane network.
  • agent_host corresponds to the control-plane network.
  1. 两个容易被忽略的配置细节 细节 1:不要混用部署模板中的字段 默认分布式示例不包含 proxy_port 或 az。避免基于假设复制另一个拓扑并删除字段。配置解析器或部署过程不保证会忽略额外字段。请从与您的目标架构匹配的官方示例开始,然后修改您的环境所需的值。

细节 2:根据网络设计分配 host 和 agent_host host 和 agent_host 字段必须反映实际的双网卡网络规划。在本文描述的部署设计中:

  • host 对应数据平面网络。
  • agent_host 对应控制平面网络。