YashanDB Database Integration Guide

HAP Server uses MySQL as its default relational database. Since v7.0.2, it also supports YashanDB. For environments with domestic technology requirements, you can use this database instead of MySQL.
Follow these integration steps:
-
Deploy YashanDB V23 in MySQL mode, using a standalone or primary-standby configuration.
For HAP standalone deployments or simplified clusters, choose standalone mode. For standard or professional clusters, choose primary-standby mode.
-
Download the HAP database initialization scripts.
-
Initialize the data
Connect to YashanDB using yasql, which is available after deployment.
Run the initialization scripts (adjust the IP address, port, username and SQL file paths for your environment). Enter the password when prompted.
yasql sys/******@127.0.0.1:1688 -f /usr/local/init_yashan/1_MDProject.sqlyasql sys/******@127.0.0.1:1688 -f /usr/local/init_yashan/2_MDStructure.sqlyasql sys/******@127.0.0.1:1688 -f /usr/local/init_yashan/3_MDApplication.sqlyasql sys/******@127.0.0.1:1688 -f /usr/local/init_yashan/4_MDCalendar.sqlyasql sys/******@127.0.0.1:1688 -f /usr/local/init_yashan/5_MDLog.sqlyasql sys/******@127.0.0.1:1688 -f /usr/local/init_yashan/6_Data_MDProject.sqlyasql sys/******@127.0.0.1:1688 -f /usr/local/init_yashan/7_Data_MDApplication.sql -
Initialize HAP services
Before initializing services, add the following environment variables (replace connection parameter values with actual values; the username and port here differ from those used by yasql):
ENV_RDB_TYPE: "11"ENV_RDB_URI_MDPROJECT: "Server=127.0.0.1;Port=1690;Database=mdproject;User ID=SYS;Password=******;AllowPublicKeyRetrieval=True;Pooling=false"ENV_RDB_URI_MDLOG: "Server=127.0.0.1;Port=1690;Database=mdlog;User ID=SYS;Password=******;AllowPublicKeyRetrieval=True;Pooling=false"ENV_RDB_URI_MDSTRUCTURE: "Server=127.0.0.1;Port=1690;Database=mdstructure;User ID=SYS;Password=******;AllowPublicKeyRetrieval=True;Pooling=false"ENV_RDB_URI_MDCALENDAR: "Server=127.0.0.1;Port=1690;Database=mdcalendar;User ID=SYS;Password=******;AllowPublicKeyRetrieval=True;Pooling=false"ENV_RDB_URI_MDAPPLICATION: "Server=127.0.0.1;Port=1690;Database=mdapplication;User ID=SYS;Password=******;AllowPublicKeyRetrieval=True;Pooling=false"ENV_STANDALONE_DISABLE_SERVICES: "mysql" -
Complete the remaining system initialization steps.