A database reinstall is not simply a matter of running the installer again. For GBase Database(GBase 8c), a reliable clean reinstall requires five stages: cleanup, configuration review, installation, acceptance, and documentation.

Skipping any stage can turn one reinstall into multiple failed attempts.

This guide walks through the complete GBase Database reinstall process, from removing residual resources to verifying database connectivity.

1. Clean Up the Previous Installation

Before starting a new installation, inspect the environment left by the previous attempt.

Check running database processes:

ps -ef | grep gaussdb 

Check the previous installation directory:

ls -A /home/gbase/gbase_db 

Check whether relevant service ports are still occupied:

ss -tlnp | grep -E ':(20001|2379|6666|5432|15432) ' 

These checks help identify three common sources of reinstall failures:

  • Residual database processes.
  • Files left in the previous installation directory.
  • Ports still occupied by previous services or other applications.

Do not delete directories or terminate processes blindly. Identify their ownership and confirm that they belong to the failed installation before performing cleanup.

A clean environment is the starting point for a predictable GBase Database reinstall.

2. Review the gbase.yml Configuration

The next step is to confirm that the configuration file is correct.

A common mistake is reusing the same gbase.yml that caused the previous installation failure.

Before reinstalling GBase Database(GBase 8c), review the following:

  • Is the YAML syntax valid?
  • Are the hostnames and IP addresses correct?
  • Are the installation paths valid?
  • Are the configured versions consistent across nodes?
  • Has the previous configuration error been corrected?
  • Is the installation prefix empty and owned by the gbase user?

For example, check the installation directory:

ls -ld /home/gbase/ ls -A /home/gbase/gbase_db 

If /home/gbase/gbase_db is the configured installation prefix, verify that it meets the requirements of the installation procedure before proceeding.

The configuration file defines the intended deployment. Reinstalling without correcting a configuration problem simply reproduces the original failure.

3. Run Pre-install Checks and Install GBase Database

Once cleanup and configuration review are complete, execute the installation procedure.

First, enter the package script directory:

cd /home/gbase/gbase_package/script/ 

Run the SSH trust and user configuration step:

./gha_preinstall -s --root-passwd="***" --set-user-passwd="***" -f /home/gbase/gbase.yml 

Replace the masked values with the appropriate credentials. Avoid storing plaintext passwords in shared scripts or deployment logs.

Next, execute the environment checks:

./gha_preinstall -i A -f /home/gbase/gbase.yml 

Important: All A1–A18 checks must report Normal before continuing. Resolve any Warning or Abnormal results according to the applicable installation requirements rather than treating the check as passed.

Then execute the security checks:

./gha_preinstall -i B -f /home/gbase/gbase.yml 

This stage covers:

  • B1: SELinux
  • B2: Firewall

Review the results and apply the required security configuration.

After the pre-install checks are complete, start the installation:

./gha_ctl install -p /home/gbase/ -c gbase 

A successful installation returns:

{"ret":0,"msg":"Success"} 

This confirms that the installation command completed successfully. Cluster health and database connectivity still need separate verification.

4. Verify Cluster State and Database Connectivity

Installation success is not the same as deployment acceptance.

For GBase Database(GBase 8c), verify the cluster state first:

gha_ctl monitor all -l http://10.x.x.6:2379 -H 

Replace the example address with the actual DCS endpoint.

Review the status of the cluster components and confirm that the expected instances are running and stable.

Next, verify database connectivity:

gsql -d postgres -p 5432 -r -c "select 1" 

This command connects to the postgres database through port 5432 and executes a basic SQL query.

A successful result confirms that the client can establish a connection and execute a read query.

For a more complete acceptance process, verify four areas:

Check What to Verify
State Cluster components are running and stable
Listening Expected service ports are listening
Connection The database client can connect
Read/Write Basic query and controlled write operations succeed

Do not rely on the installation success message alone. A clean reinstall is complete only after the database passes its acceptance checks.

5. Record the Installation and Acceptance Results

The final step is documentation.

Archive the following information:

  • Installation command output.
  • Pre-install check results.
  • Configuration file version.
  • Cluster monitoring output.
  • Database connection results.
  • Read/write acceptance results.

These records provide a baseline for future troubleshooting and maintenance.

When the next GBase Database installation fails, engineers can compare the current environment with a previously verified deployment instead of starting from assumptions.

Five Checks Before Every Reinstall

Before executing the installer, confirm these five conditions:

  1. Cleanup completed: No unintended residual processes, directories, or occupied ports.
  2. Configuration corrected: gbase.yml reflects the intended deployment.
  3. Versions consistent: Software versions match the deployment requirements across nodes.
  4. Architecture matched: The configuration reflects the intended cluster topology.
  5. Dependencies present: Required packages and system prerequisites are available.

Completing these checks before installation is much cheaper than discovering problems halfway through deployment.

Conclusion

A clean reinstall of GBase Database(GBase 8c) is a controlled process, not a repeated command execution.

Clean up the previous environment, review the configuration, run pre-install checks, execute the installation, verify the database, and preserve the results.

The installer may finish quickly, but recovering from an incomplete or poorly verified reinstall takes much longer.

Treat every reinstall as a deployment project, not just another installation attempt.