DEV Community

Michael
Michael

Posted on

Installing GDOM with a PostgreSQL Resource Library for GBase 8a

GDOM (GBase Database Operation Manager), the China-domestically developed operations tool from GBASE, supports both PostgreSQL and mysql as its resource library as of 3.2B2. This post records an install backed by an existing third-party PostgreSQL instance. From GDOM 3.7.0 onward PostgreSQL can be installed automatically, so use the bundled one if no external instance is available.

The test instance was postgresql14-14.9-2PGDG.rhel7.x86_64.rpm and had to be installed beforehand. Everything below runs from the unpacked installer directory.

Prerequisites

Without expect the shell scripts will not run:

yum install expect
./gdomSetupRPM.sh redhat7-x86_64
Enter fullscreen mode Exit fullscreen mode

Supported OS types are redhat7-x86_64, redhat8-x86_64, kylin10-x86_64 and kylin10-aarch64.

Configuring demo.options

The parameters that matter (full reference is in README.PDF inside the package):

# Install directory; create it first and make sure user has access
gdomRoot=/opt/gdom
gdomService=10.0.2.103
# nginx sits in front, so 8080 is not the public port
gdomServicePort=8080
# Use a dedicated OS user, not an existing one
user=gdom

# Third-party PostgreSQL: leave gdomDb empty
gdomDb=
gdomDbPort=5432
gdomDbUser=postgres
gdomDbPwd=625562
gdomDbDriver=org.postgresql.Driver

# Setting gdomDbUrl overrides gdomDb.
# This JDBC URL MUST NOT include a database name, or the install cannot connect.
gdomDbUrl='jdbc:postgresql://10.0.2.103:5432/?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&useSSL=true&serverTimezone=GMT%2B8&allowMultiQueries=true'

# Analysis store uses 6258 because 5258 is already taken by the local cluster
gdomGBaseDb=10.0.2.103
gdomGBaseDbPort=6258
gdomGBaseDbUser=gbase2
gdomGBaseDbPwd=gbase2

gdomNginx=10.0.2.103
gdomNginxPort=8810
gdomRedis=10.0.2.103
gdomRedisPort=7481
gdomMq=10.0.2.103
gdomMqPort=9876
gdomDashBoardPort=9898
Enter fullscreen mode Exit fullscreen mode

If a database name slips into the URL, fix it afterwards in gdom/install/gdom-service/config/application.properties.

Configuring mutual trust

Run as root; the script creates the OS user named by user and sets up SSH trust, prompting once for the root password and once for the gdom password:

./gdomMutualTrust.sh -a
Enter fullscreen mode Exit fullscreen mode

It distributes keys with ssh-copy-id. If you hit /usr/bin/ssh-copy-id: ERROR: invalid option (-f), edit gdomTrust.exp and remove the -f flag after ssh-copy-id.

Installing

Move the package under the install user, fix ownership, then run the installer as that user:

mv /root/GDOM-v3.2.0-build2-redhat7-x86_64 /home/gdom/GDOM-v3.2.0-build2-redhat7-x86_64
chown -R gdom:gdom /home/gdom/GDOM-v3.2.0-build2-redhat7-x86_64
su - gdom
cd GDOM-v3.2.0-build2-redhat7-x86_64/
./gdomInstall.sh -a
Enter fullscreen mode Exit fullscreen mode

The installer checks ports, distributes packages, unpacks and configures middleware, then initializes the stores. Port checks:

10.0.2.103 GDOM Service 8080 available
Skipped, using third-party resource library   <- GDOM DB
Skipped, no HaProxy
10.0.2.103 GBase 6258 available
10.0.2.103 Nginx 8810 available
10.0.2.103 Redis 7481 available
10.0.2.103 Redis 9876 available              <- RocketMQ
Enter fullscreen mode Exit fullscreen mode

Main packages shipped: gdom-service-3.2.0.tar.gz (216 MB)​, jdk-1.8.0_411 (140 MB)​, gdom-agent.tar.gz (130 MB)​, GBase8a-NoLicense-9.5.3.28.11 (61 MB)​ and rocketmq-all-5.2.0 (144 MB)​, plus nginx 1.27.0 and redis 6.2.7. Configuration sets gbase_8a_gbase8a.cnf to port 6258, points the master datasource at org.postgresql.Driver, and the analysis datasource at jdbc:gbase://10.0.2.103:6258/gdom_real.

Resource-library initialization is skipped because a third-party database is in use, while the analysis stores gdom_real and gdom_history get their schemas and stored procedures created automatically.

Initializing the PostgreSQL database

Run two scripts with psql or another client — schema first, then data (adjust names to the actual directory):

psql -d gdom -f /opt/gdom/install/sql/gdom_init_pg.sql
psql -d gdom -f /opt/gdom/install/sql/gdom_init_pg_data.sql
Enter fullscreen mode Exit fullscreen mode

The installer log names the data script gdom_init_data_pg.sql, while the distribution listing and the command above use gdom_init_pg_data.sql; use whichever file actually exists under /opt/gdom/install/sql.

Starting, accessing and stopping

./gdomStart.sh -a     # GBase / Redis / Nginx / RocketMQ / GDOM Service
./gdomStop.sh  -s     # stop GDOM Service
Enter fullscreen mode Exit fullscreen mode

Once startup finishes, open http://10.0.2.103:8810. This install ran in a VM, so an IP mapping was used.

Going forward, the interesting part is the split of responsibility: GDOM still orchestrates the whole middleware stack and the gbase analysis database, and only the resource-library step is left to the DBA. Later releases are expected to automate PostgreSQL initialization and fresh PostgreSQL installation as well, which would make the external database setup optional entirely.

Top comments (0)