Skip to main content

GBase 8c Database Integration Guide

HAP Server uses MySQL as its default relational database. Since v5.6.0, it also supports GBase 8c. For environments with domestic technology requirements, you can use this database instead of MySQL.

Follow these integration steps:

  1. Deploy GBase 8c V5 in standalone or primary-standby mode.

    For HAP standalone deployments or simplified clusters, choose standalone mode. For standard or professional clusters, choose primary-standby mode.

  2. After deploying GBase 8c, download the HAP database initialization scripts and upload them to the GBase 8c environment.

  3. Initialize the data

    Connect using gsql and run the initialization scripts (adjust the IP address, port, username, password and SQL file paths for your environment).

    gsql -h 127.0.0.1 -p 15400 -U gbase8c -W ****** -d postgres -f /usr/local/init_gbase8c/1_Database.sql
    gsql -h 127.0.0.1 -p 15400 -U gbase8c -W ****** -d mdproject -f /usr/local/init_gbase8c/2_MDProject.sql
    gsql -h 127.0.0.1 -p 15400 -U gbase8c -W ****** -d mdstructure -f /usr/local/init_gbase8c/3_MDStructure.sql
    gsql -h 127.0.0.1 -p 15400 -U gbase8c -W ****** -d mdapplication -f /usr/local/init_gbase8c/4_MDApplication.sql
    gsql -h 127.0.0.1 -p 15400 -U gbase8c -W ****** -d mdcalendar -f /usr/local/init_gbase8c/5_MDCalendar.sql
    gsql -h 127.0.0.1 -p 15400 -U gbase8c -W ****** -d mdlog -f /usr/local/init_gbase8c/6_MDLog.sql
    gsql -h 127.0.0.1 -p 15400 -U gbase8c -W ****** -d mdproject -f /usr/local/init_gbase8c/7_Data_MDProject.sql
    gsql -h 127.0.0.1 -p 15400 -U gbase8c -W ****** -d mdapplication -f /usr/local/init_gbase8c/8_Data_MDApplication.sql

  4. Initialize HAP services

    Before initializing services, add the following environment variables (replace connection parameter values with actual values):

    ENV_RDB_TYPE: "7"
    ENV_RDB_URI_MDPROJECT: "Host=127.0.0.1;Port=15400;Username=gbase8c;Password=******;Database=mdproject;No Reset On Close=true"
    ENV_RDB_URI_MDLOG: "Host=127.0.0.1;Port=15400;Username=gbase8c;Password=******;Database=mdlog;No Reset On Close=true"
    ENV_RDB_URI_MDSTRUCTURE: "Host=127.0.0.1;Port=15400;Username=gbase8c;Password=******;Database=mdstructure;No Reset On Close=true"
    ENV_RDB_URI_MDCALENDAR: "Host=127.0.0.1;Port=15400;Username=gbase8c;Password=******;Database=mdcalendar;No Reset On Close=true"
    ENV_RDB_URI_MDAPPLICATION: "Host=127.0.0.1;Port=15400;Username=gbase8c;Password=******;Database=mdapplication;No Reset On Close=true"
    ENV_STANDALONE_DISABLE_SERVICES: "mysql"
  5. Complete the remaining system initialization steps.