openGauss Database Integration Guide
HAP Server uses MySQL as its default relational database. Since v6.2.0, it also supports openGauss (free and open source). For environments with domestic technology requirements, you can use this database instead of MySQL.
Follow these integration steps:
-
Install openGauss 6.0.0 or later using the Installation Guide, in standalone or primary-standby mode (Enterprise or Minimal Edition).
For HAP standalone deployments or simplified clusters, choose standalone mode. For standard or professional clusters, choose primary-standby mode.
-
After deploying openGauss, download the HAP database initialization scripts and upload them to the openGauss environment.
-
Initialize the data
Connect to openGauss using gsql, which is included with the deployment.
Run the initialization scripts (adjust the IP address, port, username and SQL file paths for your environment). Enter the password when prompted.
gsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/1_Database_g.sql -d postgresgsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/1_Database_s.sql -d mdprojectgsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/1_Database_s.sql -d mdapplicationgsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/1_Database_s.sql -d mdcalendargsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/1_Database_s.sql -d mdstructuregsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/1_Database_s.sql -d mdloggsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/2_MDProject.sql -d mdprojectgsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/3_MDStructure.sql -d mdstructuregsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/4_MDApplication.sql -d mdapplicationgsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/5_MDCalendar.sql -d mdcalendargsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/6_MDLog.sql -d mdloggsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/7_Data_MDProject.sql -d mdprojectgsql -h 127.0.0.1 -p 5432 -U omm -f /usr/local/init_opengauss/8_Data_MDApplication.sql -d mdapplication -
Initialize HAP services
Before initializing services, add the following environment variables (replace connection parameter values with actual values):
ENV_RDB_TYPE: "9"ENV_RDB_URI_MDPROJECT: "Host=127.0.0.1;Port=5432;Username=gaussdb;Password=******;Database=mdproject;No Reset On Close=true"ENV_RDB_URI_MDLOG: "Host=127.0.0.1;Port=5432;Username=gaussdb;Password=******;Database=mdlog;No Reset On Close=true"ENV_RDB_URI_MDSTRUCTURE: "Host=127.0.0.1;Port=5432;Username=gaussdb;Password=******;Database=mdstructure;No Reset On Close=true"ENV_RDB_URI_MDCALENDAR: "Host=127.0.0.1;Port=5432;Username=gaussdb;Password=******;Database=mdcalendar;No Reset On Close=true"ENV_RDB_URI_MDAPPLICATION: "Host=127.0.0.1;Port=5432;Username=gaussdb;Password=******;Database=mdapplication;No Reset On Close=true"ENV_STANDALONE_DISABLE_SERVICES: "mysql" -
Complete the remaining system initialization steps.