π GBase 8c Uninstall: Safe 2-Step Cleanup Now
Learn GBase 8c uninstall in a safe 2-step cleanup: back up, run gha_ctl uninstall, remove cluster & DCS metadata, then verify processes, files, ports.

How to Completely Uninstall GBase 8c Without Leaving Stale Metadata
Uninstalling GBase Database 8c isn't just "run a command and look for success." Removing the cluster and cleaning up its Distributed Configuration Store (DCS) metadata are two separate operations. If you stop after the first one, the database instances may be gone - but the cluster information can still sit in DCS.
That distinction matters when you're decommissioning, rebuilding, or cleaning up after a failed deployment. Stale metadata can make it harder to tell what's actually running and can slow down whatever you do next. Also, the DCS cleanup is destructive: there's no rollback. So you want to find backup issues before you run it, not after.
This guide covers a cautious, complete uninstall: confirm your recovery plan, run the cluster uninstall, clear DCS metadata from the package script directory, then check the host for remaining processes, files, and listeners. It also clarifies what the "success" responses do - and don't - prove, so you can close the change with evidence instead of assumptions.
Before You Uninstall: Protect Data and Confirm Scope
Think of a database uninstall as an operational change, not routine file cleanup. Before you run either command, confirm you're targeting the right GBase 8c cluster and that the data can be recovered if something goes sideways.
Verify that the backup is usable
A backup job marked complete isn't enough on its own. Make sure the backup files exist, are readable, and look intact. Also confirm the recorded backup path is the one you expect.
Double-check permissions, too: the account running the operation must be able to access the backup files and their storage location.
Where your recovery process allows it, use a tested restore or your environment's established verification steps. The goal isn't just to "have backups." It's to know the team can access them and that recovery is realistic.
And this matters even more before the DCS cleanup. The source procedure describes the DCS operation as irreversible and without a rollback path. Don't assume you can reconstruct metadata later just because the cluster uninstall worked.
Confirm dependencies and the target DCS endpoint
Confirm business services have been stopped or moved as planned, and that you've accounted for active connections. Coordinate with the service owner and anyone managing the environment so you don't remove a cluster that an application is still using.
You also need the correct DCS endpoint for the deployment. The examples below use http://10.x.x.6:2379 as a placeholder - replace it with your real address. Don't copy the placeholder into production.
Before you execute anything, record the cluster identity, the endpoint, the planned change window, and who will verify results. Since the DCS step is destructive, being able to show what you targeted is part of safe execution.
Use a stop condition
Don't proceed if any of these are unresolved: unverified backups, an unclear target cluster, missing required access, or an unconfirmed DCS address. A short pause now is cheaper than realizing you targeted the wrong environment or that your only recovery copy won't read.
Step One: Uninstall the GBase 8c Cluster
Run the first command using the DCS endpoint for the deployment you're actually uninstalling:
gha_ctl uninstall -c gbase -l http://10.x.x.6:2379
Replace 10.x.x.6 with the DCS address used by your deployment. Keep the exact command and endpoint in your change record so someone else can verify what was run.
Interpret the response narrowly
A successful run returns:
{"ret":0,"msg":"Success"}
Treat that as confirmation that the cluster uninstall command completed. Don't treat it as proof that everything related to the deployment is fully removed. In particular, DCS metadata is handled separately, which is why you still need the second command.
In practice: command success tells you the operation ran, not that the entire environment is now in the final desired state. Keep the uninstall and DCS cleanup as two steps, not one vague "it worked" moment.
If the first command does not return success
Don't move on to the DCS destruction step as if the cluster removal finished normally. Capture the exact output, then investigate the failure using the procedures for your installed GBase version and deployment.
Confirm the endpoint and execution context before retrying. Re-running blindly can make troubleshooting harder, especially when you're dealing with partial failures or ambiguous state.
Also note: the source procedure may list the expected success response, but it won't spell out a recovery path for every possible error condition. If the result is unclear, pause and use the appropriate operational support path rather than guessing. Same goes if the command "succeeds" but the host/cluster state doesn't match what you expected.
Record completion before moving on
Once the cluster command returns the expected success response, record the command, time, endpoint, and response in the change ticket. Then proceed to the separate DCS cleanup. Keeping the results distinct makes it clear which step completed and whether the metadata operation was actually performed.
Step Two: Clear the DCS Metadata
Cluster removal doesn't automatically clear the matching DCS metadata. To finish the uninstall, run the DCS destruction command separately. Because the command is executed from the package script directory, switch into that directory first:
cd /home/gbase/gbase_package/script
Then run:
./gha_ctl destroy dcs -l http://10.x.x.6:2379
As before, substitute the DCS address for your deployment. Don't run this against an unverified endpoint. The operation destroys DCS metadata and has no rollback, so confirm the target and backup status again before executing it.
Why the command must be run from the script directory
The command is invoked as ./gha_ctl, so the shell expects the executable in the current directory. If you run it from elsewhere, you can hit a command-not-found issue.
Use the explicit cd shown above, and verify your working directory if there's any doubt. If the package is installed in a different location in your environment, don't assume this example path applies - find the correct package script directory for that deployment and follow the version-specific procedure.
Understand what the second command changes
GBase treats cluster management and distributed metadata as separate responsibilities:
gha_ctl uninstallremoves the database cluster (including instances and configuration).gha_ctl destroy dcsremoves the corresponding DCS metadata.
If you skip the second operation, DCS can keep information about a cluster whose database instances are already gone. That's how a "success" uninstall can still leave the overall decommission incomplete.
A successful DCS cleanup returns:
{"ret":0,"msg":"Success"}
Record this response separately from the cluster uninstall result. If the DCS command fails, returns an unexpected response, or you can't clearly confirm its effect, stop and investigate. The source procedure doesn't provide a universal recovery path for partial failures, so rely on the procedure and support process that matches your installation.
One endpoint is used for the operation
The command accepts a DCS endpoint, such as -l http://10.x.x.6:2379. Per the procedure, you don't manually repeat the operation against every DCS node. The command communicates with the DCS service through the endpoint you provide.
That doesn't mean endpoint selection is optional. Use an address that belongs to the intended DCS service and is reachable from the host running the command. The procedure also notes that environment variables are cleared automatically during uninstall; that's not a substitute for checking the remaining host state after the fact.
Verify the Host Before Closing the Change
Two successful command responses are necessary, but they aren't a full host audit. Before you mark the change complete, check what's left locally: running processes, leftover installation-related files, and listening ports.
Check for remaining processes
Use this command to look for database-related processes:
ps -ef | grep -E 'gaussdb|gha_ctl'
Review the output rather than assuming any match means "bad." The grep command itself can show up in the results, and your search terms can also match text that isn't an actual running database process. Identify the real processes before deciding the host is clean or dirty.
If you find a process that seems related to the removed cluster, don't kill it automatically. Confirm what it is, whether it belongs to the target deployment, and whether another service still depends on it. A process check is a trigger for investigation, not permission to terminate anything that matches a pattern.
Inspect directories before removing anything
Check the installation directory and package-related locations for residual files. Make sure you understand which directory belongs to the uninstalled cluster and whether it's still needed before deleting anything.
Avoid broad recursive deletion just because a path looks familiar. This is where "uninstalling software" and "cleaning a host" can diverge. A leftover file might be harmless, useful for investigation, or shared with another deployment. Removing it without confirming ownership can turn a completed database change into a separate service incident.
If the directory's purpose isn't clear, leave it alone for now and sort out ownership first.
Check listening ports
Check for listeners that may have been used by the database service:
ss -tlnp
Investigate any remaining listener that looks related to the removed environment. An open port doesn't automatically mean it belongs to GBase 8c - use the process information and deployment context to determine who owns it. Don't stop an unrelated service just because it's using a port you expected to be freed.
Close with evidence, not inference
Before you close the change ticket, confirm each item:
- Backup completed and verified readable.
- Business services stopped and active connections considered.
-
gha_ctl uninstallcompleted successfully. -
gha_ctl destroy dcscompleted successfully from the package script directory. - No unintended database-related processes remain.
- No unnecessary installation directories remain.
- No unintended service ports remain occupied.
- Both commands, their endpoints, and their execution results are recorded.
These checks don't prove every trace of the installation is gone forever. What they do provide is a focused, reviewable basis for deciding whether the host and DCS cleanup match the intended scope. If something's still unexplained, keep the change open until ownership and impact are clear.
Conclusion: Treat Uninstall as a Change, Not Cleanup
A complete GBase 8c uninstall has two distinct operations: remove the database cluster with gha_ctl uninstall, then clear its DCS metadata with gha_ctl destroy dcs. The second command isn't optional cleanup. Without it, stale cluster information may remain in DCS after the instances are gone.
Verify you have a readable backup before starting, confirm the endpoint and where you're running the command from, and treat DCS destruction as irreversible. After both commands return success, check processes, directories, and ports rather than assuming the host is clean. Record both command results and your verification outcomes in the change ticket.
The sequence is straightforward, but the controls are what keep it safe: one verified backup, two separately confirmed operations, and three focused post-uninstall checks. That's a more defensible finish than relying on a single success message.