GBase Tech Moment | A Step-by-Step Guide to GBase 8s Enterprise Replication (ER) Configuration and Best Practices
In the deep waters of enterprise digital transformation, business continuity and data reliability for core systems have become lifelines. A high-availability database architecture is the cornerstone that safeguards this lifeline. GBase 8s Enterprise Replication (ER) is precisely the core weapon designed for this purpose. This article provides a clear, hands-on guide to building and deploying a GBase 8s ER environment from scratch.
We will take two physical or virtual servers as an example to build a dual-node architecture with mutual backup.
Configure Operating System Mutual Authentication
1) Modify /etc/hosts.equiv (create if it does not exist)
Node1:
Node2:
2) Modify /etc/ssh/sshd_config
3) Configure SSH mutual trust
Create the .ssh directory under the ~gbasedbt home directory on both machines and execute the following steps as the gbasedbt user:
After execution, exchange the authorized_keys files between the two nodes.
Set the permissions of authorized_keys to 644 and .ssh to 755.
4) Disable SELinux and the firewall
Configure CDR
First, install the GBase 8s database on both servers separately. The installation process is not covered here.
1) Add the service ports of the remote hosts to the /etc/services file
Add on Node1:
Add on Node2:
2) Modify the sqlhost files of both instances
$GBASEDBTDIR/etc/sqlhost.gbaseserver_1
$GBASEDBTDIR/etc/sqlhost.gbaseserver_2
3) Create data space
Take gbaseserver_1 as an example; the steps for gbaseserver_2 are identical.
4) Create log synchronization directories
5) Modify the configuration files of both instances separately
onconfig.gbaseserver_1
onconfig.gbaseserver_2
6) Restart the database for the configuration to take effect
7) Set up clock synchronization
8) Create a test database and test tables
Node1:
Node2:
Set Up Replication Rules
ER supports multiple flexible replication modes, including update-anywhere, update-target, and conditional replication. Here we will introduce update-anywhere as an example:
1) Configure the primary server
Execute on Node1:
2) Configure the standby server
Execute on Node2:
3) View the list of enterprise replication servers
4) Configure synchronization rules
At this point, the replication is Inactive.
5) Start the sync primary server and application server
At this point, all configurations are complete.
With these steps, we have successfully deployed a basic GBase 8s ER high-availability environment capable of bidirectional data synchronization. This architecture not only effectively prevents single points of failure and provides disaster recovery protection for critical business, but also lays a solid foundation for advanced scenarios such as read/write splitting and load balancing. GBase 8s ER, with its rigorous log replication mechanism, transforms the complex challenges of distributed data consistency into clear, reliable, and manageable engineering practices, making it a key choice for building enterprise-grade data core resilience.