HomeMogDBMogDB StackUqbar
v5.0

Documentation:v5.0

Supported Versions:

Other Versions:

MogDB/CM/PTK Dual Network Segment Support

Availability

This feature is available since MogDB 5.0.6.

Introduction

MogDB/CM/PTK now supports dual network segment configurations in system deployment to strengthen the high availability of database clusters.

Benefits

With dual network segments deployed, the database cluster can continue to operate normally even if a single network segment fails, thus providing high availability management at the network segment level.

Description

Traditionally, dual network segments rely on hardware configuration, binding two independent network segments together through VLAN technology, and then configuring them to the database cluster. This feature provides dual network segment support for MogDB and CM at the software level, eliminating the dependency on switching equipment.

CM Support for Dual Network Segment Deployment

As the high availability management tool for MogDB, CM supports dual network segment deployment with the following fault handling logic:

  • In the case of a single-node single-network segment failure, the mogdb and cm_server processes on that node continue to work normally, maintaining their roles, and the communication between cm_agent and cm_server will automatically switch to the normal network segment.
  • In the case of a single-node dual-network segment failure, the node's network is completely interrupted, and the mogdb and cm_server processes will be terminated, stopping the service.
  • In the case of multi-node single-network segment failures, the cluster operates normally.

PTK Support for MogDB Dual Network Segment Installation and Deployment

PTK adapts to CM, enabling dual network segment deployment by configuring the ha_ips parameter in the config.yaml file. ha_ips should be configured under each node in db_servers as a list, including the IP of the second network segment. The current version supports a maximum of one IP configuration.

When deploying a two-node (one primary and one standby) setup, the third_party_gateway_ip parameter in the yaml configuration file (which is a third-party gateway for a single network segment) should be set as a dual network segment parameter, separated by a comma, such as third_party_gateway_ip: 172.0.0.17,10.0.0.17.

For single network segment deployment, third_party_gateway_ip only needs to be configured with one IP; for dual network segment deployment, third_party_gateway_ip requires two third-party gateway IPs for each network segment, separated by a comma.

Note:

  • The network segments referred to in this feature are at the internal network level of the database cluster, that is, the HA management network and the data network, and do not involve the application layer network.
  • When deploying dual network segments, PTK will automatically establish SSH mutual trust between the two network segments of the nodes.

Example configuration file for two-node (one primary and one standby) installation:

# config.yaml
global:
  cluster_name: test51
  user: test51
  group: test51
  db_password: pTk6NjM4ZmRkOWE8Qz08PUQ/RXU5NTFmaDZwZTdmSU9zcGh4OWJ1S2ZzcGxKdG40R0lyaHdaMGJKb3lTa2s=
  db_port: 24635
  base_dir: /data/test51/mogdb
  db_conf:
    log_min_messages: 'DEBUG5'
  ssh_option:
    port: 22
    user: root
    key_file: "/root/.ssh/id_rsa"
  cm_option:
    cm_server_port: 24678
    cm_server_conf:
      ddb_type: 1
      enable_ssl: on
      third_party_gateway_ip: 172.0.0.17,10.0.0.17
      cms_enable_failover_on2nodes: 'true'
      cms_enable_db_crash_recovery: 'true'
      log_min_messages: 'DEBUG5'
    cm_agent_conf:
      enable_ssl: on
      log_min_messages: 'DEBUG5'
db_servers:
  - host: 172.0.0.12
    role: primary
    az_name: AZ1
    az_priority: 1
    ha_ips: [10.0.0.12]
    ssh_option:
      password: pTk6NjM4ZmRkOWE8Qz08PUQ/RXU5NTFmaDZwZTdmSU9zcGh4OWJ1S2ZzcGxKdG40R0lyaHdaMGJKb3lTa2s=
  - host: 172.0.0.22
    role: standby
    az_name: AZ1
    az_priority: 1
    ha_ips: [10.0.0.22]
    ssh_option:
      password: pTk6NjM4ZmRkOWE8Qz08PUQ/RXU5NTFmaDZwZTdmSU9zcGh4OWJ1S2ZzcGxKdG40R0lyaHdaMGJKb3lTa2s=

Example configuration file for three-node (one primary and two standby) installation:

# config.yaml
global:
  cluster_name: test50
  user: test50
  group: test50
  db_password: pTk6NjM4ZmRkOWE8Qz08PUQ/RXU5NTFmaDZwZTdmSU9zcGh4OWJ1S2ZzcGxKdG40R0lyaHdaMGJKb3lTa2s=
  db_port: 24635
  base_dir: /data/test50/mogdb
  db_conf:
    log_min_messages: 'DEBUG5'
  ssh_option:
    port: 22
    user: root
    key_file: "/root/.ssh/id_rsa"
  cm_option:
    cm_server_port: 24678
    cm_server_conf:
      ddb_type: 1
      enable_ssl: on
      cms_enable_failover_on2nodes: 'true'
      cms_enable_db_crash_recovery: 'true'
      log_min_messages: 'DEBUG5'
    cm_agent_conf:
      enable_ssl: on
      log_min_messages: 'DEBUG5'
db_servers:
  - host: 172.0.0.12
    role: primary
    az_name: AZ1
    az_priority: 1
    ha_ips: [10.0.0.12]
    ssh_option:
      password: pTk6NjM4ZmRkOWE8Qz08PUQ/RXU5NTFmaDZwZTdmSU9zcGh4OWJ1S2ZzcGxKdG40R0lyaHdaMGJKb3lTa2s=
  - host: 172.0.0.22
    role: standby
    az_name: AZ1
    az_priority: 1
    ha_ips: [10.0.0.22]
    ssh_option:
      password: pTk6NjM4ZmRkOWE8Qz08PUQ/RXU5NTFmaDZwZTdmSU9zcGh4OWJ1S2ZzcGxKdG40R0lyaHdaMGJKb3lTa2s=
  - host: 172.0.0.43
    role: standby
    az_name: AZ1
    az_priority: 1
    ha_ips: [10.0.0.43]
    ssh_option:
      password: pTk6NjM4ZmRkOWE8Qz08PUQ/RXU5NTFmaDZwZTdmSU9zcGh4OWJ1S2ZzcGxKdG40R0lyaHdaMGJKb3lTa2s=

Mounting VIP By PTK

Use the PTK command to mount VIP for the cluster

ptk cluster -n CLUSTER_NAME load-cm-vip --action install --vip VIP

CLUSTER_NAME is the cluster name and VIP is the vip to be mounted, note that the mounted VIP segment needs to be consistent with the target segment. A single-segment cluster environment can mount one VIP, and a two-segment cluster environment can mount two VIPs (one for each segment).

Constraints

  • This feature depends on PTK version 1.4 or above.
  • The VIP mounted by this feature is limited to IPV4 and does not support IPV6 at the moment.
  • Each node in the database cluster configured for dual network segments must have at least two network segments.
  • Dual network segment deployment does not support cross-segment fault scenarios (e.g., node 1 has a fault in segment 1, and node 2 has a fault in segment 2).
  • Ping permissions must be enabled on the corresponding segments of the deployment nodes.
  • After a network segment failure, the stream replication switchover of MogDB occurs after the time specified by the wal_receiver_timeout parameter. Reducing the value of this parameter can speed up the switchover time of MogDB's stream replication.
  • When a single network segment fault occurs on a node, the cluster continues to operate normally. After the segment is restored, due to the time required for the DCF to establish TCP connections and acquire resources, it takes about 15 seconds for the segment to reconnect normally.
  • Due to the configuration limits of MogDB's stream replication, dual network segment deployment supports up to one primary and four standbys at most.
  • When installing and deploying clusters, it is not supported to have some nodes configured with a single network segment and some with dual network segments (the number of network segments for each node in the cluster should be consistent).
  • When scaling up or down, it is not supported to scale a single network segment cluster with dual network segment nodes, nor to scale a dual network segment cluster with single network segment nodes (i.e., the number of network segments for each node in the cluster should be consistent).
  • When deploying a two-node cluster with dual network segments, the third_party_gateway_ip parameter in the cm_sever.conf file should be configured with the third-party gateway IPs for both network segments, such as "172.0.0.17,10.0.0.17", meaning each network segment should have its own third-party gateway IP, separated by a comma.

Dependency

DCF(Distributed Consensus Framework)、DCC(Distributed Consensus Center)

Unified Database Management ToolPTK ConfigurationDCF

Copyright © 2011-2024 www.enmotech.com All rights reserved.