DEV Community

Michael
Michael

Posted on • Originally published at gbase8.cn

Accessing an IPv4 GBase 8a Cluster from IPv6 via the Gateway and dblink

During the transition from IPv4 to IPv6, you may have two GBase 8a clusters running on different IP protocols. Since IPv4 and IPv6 cannot communicate directly, the GBase Gateway acts as a bridge. This guide walks through the complete configuration, from gateway setup to dblink usage, for accessing an IPv4 cluster from an IPv6 cluster in a gbase database environment.

Environment

  • Gateway: Version GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.19, must be installed on the IPv6 cluster node (which also has an IPv4 address).
  • IPv4 cluster: Legacy cluster, e.g., 10.0.2.201.
  • IPv6 cluster: Migrated cluster with IPv6 address 2001::203, also retaining 10.0.2.203 for gateway communication.

Gateway Configuration

1. Data Source (IPv4 Cluster)

Create a file under conf/dataSource/ — the filename is the identifier you'll use in CREATE DATABASE LINK. Example ipv4_201.properties:

[ipv6201]
dataSource_IP=10.0.2.201
dataSource_port=5258
dataSource_dbname=testdb
dataSource_dbtype=gcluster
dataSource_user=gbase
dataSource_pwd=XXXXXXXX
Enter fullscreen mode Exit fullscreen mode

2. Target Cluster (IPv6)

Edit conf/gcluster/gbase8a_gcluster.properties. The user must match the logged‑in user, and you must configure entries for both the coordinator (port 5258) and every data node (port 5050).

[gc1]
gcluster_IP=2001::203
gcluster_port=5258
gcluster_user=root
gcluster_pwd=XXXXXX
gcluster_encode=utf-8

[gn1]
gcluster_IP=2001::222
gcluster_port=5050
gcluster_user=root
gcluster_pwd=XXXXXX
gcluster_encode=utf-8
Enter fullscreen mode Exit fullscreen mode

3. Start the Gateway

cd /opt/GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.19/
sh gt.sh
Enter fullscreen mode Exit fullscreen mode

Verify with ps -ef | grep ga. Logs are in the logs directory.

IPv6 Cluster Parameters

Add the following to gbase_8a_gcluster.cnf on every coordinator node and restart:

gcluster_dblink_direct_data_exchange=0
gbase_dblink_gateway_ip=10.0.2.203
gbase_dblink_gateway_port=9898
_t_gcluster_dblink_insert_select_optimization=0
Enter fullscreen mode Exit fullscreen mode
  • gbase_dblink_gateway_ip is the IPv4 address of the gateway host.
  • Setting gcluster_dblink_direct_data_exchange=0 forces all data through the gateway, which is required when the two clusters cannot reach each other directly.

dblink Usage Examples

Create a dblink

CREATE DATABASE LINK ipv4201 CONNECT TO '' IDENTIFIED BY '' USING 'ipv4_201';
Enter fullscreen mode Exit fullscreen mode

Query remote data

SELECT * FROM d@ipv4201;
Enter fullscreen mode Exit fullscreen mode

Import data via INSERT SELECT

INSERT INTO d SELECT * FROM d@ipv4201;
Enter fullscreen mode Exit fullscreen mode

Create a table from a remote query

CREATE TABLE d2 AS SELECT * FROM d@ipv4201;
Enter fullscreen mode Exit fullscreen mode

JOINs between dblink tables

JOINs between two dblink tables are supported. JOINs between a dblink table and a local table are not allowed.

Send DDL/DML to the remote cluster

Use the PASSTHROUGH syntax to execute statements directly on the IPv4 cluster:

PASSTHROUGH LINK ipv4201 USING 'INSERT INTO d VALUES(now())';
Enter fullscreen mode Exit fullscreen mode

Note: SELECT and CALL are not supported via PASSTHROUGH.

View and drop dblinks

SELECT * FROM gbase.db_links;
DROP DATABASE LINK ipv4201;
Enter fullscreen mode Exit fullscreen mode

Critical Notes

  1. Install the gateway on an IPv6 cluster node — it must have both IPv4 and IPv6 addresses to bridge the two networks.
  2. Use a consistent IPv6 address format2001::200 and 2001::0200 are treated as different strings. Standardise the format across the cluster.
  3. The target cluster user in the gateway config must match the logged‑in user — matching is done by IP + username.
  4. Configure data node entries in the gateway — if using gateway relay mode, every data node needs a gcluster_port=5050 entry.
  5. Direct INSERT INTO table@dblink is not yet supported in the tested version.

With this setup, you can safely access an IPv4 GBase 8a cluster from an IPv6 cluster during your network migration, keeping cross‑cluster queries operational in your gbase database environment.

Top comments (0)