Cluster Uninstallation and Reinstallation

This document describes the steps to uninstall and reinstall YMatrix 6. The example uses a three-node cluster: the master node is mdw, and the two segment nodes are sdw1 and sdw2.

Before proceeding, please read the following instructions carefully:

  • If you no longer need the YMatrix software or any data in the existing cluster and want to completely remove the entire cluster and YMatrix software, perform the steps in "1 Uninstall YMatrix".
  • If you only want to reinstall the YMatrix software without losing any existing data, follow the steps in "2 Reinstall YMatrix".

Note!
Sections 1 and 2 are independent. Choose one based on your needs. Do not execute both!

1 Uninstall YMatrix

1.1 Delete the Cluster

First, prepare for uninstallation or reinstallation. This step is required; otherwise, the uninstall process may fail. Use the meta-command \q to exit the psql terminal.

postgres=# \q

On the master host, run the mxdeletesystem command to remove the database instance and all data:

$ mxdeletesystem -a

1.2 Uninstall YMatrix Software

Note!
Commands in this document are given for CentOS 7. If you are using CentOS 8, replace yum with dnf. For Ubuntu systems, replace yum with apt.

First, query the installed package name using the following command:

[<username>@mdw ~]$ yum list installed | grep matrixdb
matrixdb6.x86_64                   6.0.0+enterprise~beta.5-1.el7 installed

Note!
On Ubuntu 20.04, use dpkg -l | grep matrixdb to check the installed package name.

Then, uninstall the package. This step completely removes the YMatrix software and must be performed as a regular user with sudo privileges or as the root user on all nodes.

[<username>@mdw ~]$ sudo yum remove -y matrixdb6.x86_64

#or

[<username>@mdw ~]$ sudo yum erase -y matrixdb6.x86_64

2 Reinstall YMatrix

You can safely use this section. Reinstalling a newer or the same version within YMatrix 6 does not result in data loss. For example, upgrading from YMatrix 6.1 to 6.2, or uninstalling and reinstalling YMatrix 6.2.

2.1 Stop the Cluster

First, stop the cluster. This preparation step is necessary; otherwise, the reinstallation may fail.

Use the meta-command \q to exit the psql terminal.

postgres=# \q

In this example, the cluster is stopped using the fast mode. You may alternatively use smart or immediate mode. The table below explains the differences.

[mxadmin@mdw ~]$ mxstop -a -M fast
mxstop Mode Parameter Reject New Connections Wait for Active Processes to Finish Is Default Mode
smart -M smart Yes Yes Yes
fast -M fast Yes No (terminate connections, roll back transactions) No
immediate -M immediate Yes No (kill processes immediately) No

2.2 Uninstall YMatrix

Perform the steps described in section "1.2 Uninstall YMatrix". This removes the previously installed version of the YMatrix software.

2.3 Reinstall YMatrix

Note!
If you are using CentOS 8, replace yum with dnf. On Ubuntu systems, replace yum with apt.

Reinstall the desired version of the RPM package. Run this as a regular user with sudo privileges.

[<username>@mdw ~]$ sudo yum install -y matrixdb-6.0.0+community-1.el7.x86_64.rpm

2.4 Start the Cluster

After reinstallation, switch to the mxadmin user using sudo:

[<username>@mdw ~]$ sudo su - mxadmin

Then, start the cluster using the mxstart utility:

[mxadmin@mdw ~]$ mxstart -a

Once the cluster starts successfully, the web interface will also become available.