Cluster uninstallation and reinstallation

This document describes the steps to uninstall and reinstall YMatrix 5 in clusters. Taking three nodes as an example, the main node is mdw, and the two data nodes are sdw1 and sdw2 respectively.

Before performing the operation, be sure to read this prompt carefully:

  • When you think you no longer need the YMatrix software and all data in the existing cluster, if you want to completely delete the original cluster and YMatrix software**, you need to enable "1 YMatrix Uninstall";
  • If you just want to reinstall YMatrix software but don't want to lose any original data, you need to enable "2 YMatrix Reinstall";

Notes!

  1. 2 The parts in the serial number are independent of each other. Just select one of them according to the above prompts, and do not execute them all!

1 YMatrix Uninstall

1.1 Delete the cluster

First, you need to be prepared before uninstalling or reinstalling. This step is necessary, otherwise it will hinder the uninstall operation. Exit the terminal opened by psql through the meta command \q.

postgres=# \q

Use the mxdeletesystem command on Master to delete the database instance and data.

$ mxdeletesystem -a

1.2 YMatrix software uninstall

Notes!
The commands that appear in this article are based on the CentOS 7 operating system. If you are using a CentOS 8 operating system, you need to replace the yum command in this step with dnf; if you are using an Ubuntu system, you need to replace the yum command in this step with apt.

First, you need to query the installed program name of the cluster through the following command:

[<用户名称>@mdw ~]$ yum list installed | grep matrixdb
matrixdb5.x86_64                   5.0.0+enterprise~beta.5-1.el7 installed

Notes!
Ubuntu20.04 requires sudo apt list --installed | grep matrixdb to query the program name after the cluster is installed.

Then uninstall the program. This step will completely uninstall the YMatrix software, which needs to be run with sudo permissions or root users under normal users, on all nodes.

[<用户名称>@mdw ~]$ sudo yum remove -y matrixdb5.x86_64

#or

[<用户名称>@mdw ~]$ sudo yum erase -y matrixdb5.x86_64

2 YMatrix reinstall

If you use this part, you can rest assured that if you uninstall and reinstall the higher version or the same version in the YMatrix 5 major version, you will not lose cluster data. For example, YMatrix 5.5 upgrades to YMatrix 5.6; uninstalls YMatrix 5.5 and reinstalls YMatrix 5.5.

2.1 Stop the cluster

You need to stop the cluster first and prepare for uninstalling or reinstalling. This step is necessary, otherwise it will hinder the uninstall operation.

Exit the terminal opened by psql through the meta command \q.

postgres=# \q

In the example, you can use the fast mode to stop the cluster process, and if you need it, you can also choose smart or immediate mode to stop the cluster. The table below illustrates their differences.

[mxadmin@mdw ~]$ mxstop -a -M fast
mxstop mode parameters disable new connection wait for the process to run Is it the default mode
smart -M smart Yes Yes
fast -M fast Yes No, interrupted connection, transaction rollback No
immediate -M immediate Yes No, kill the process directly No

2.2 YMatrix Uninstall

You need to perform the "1.2 YMatrix Uninstall" above. This step will completely uninstall the original version of YMatrix software.

2.3 YMatrix reinstall

Notes!
If you are using a CentOS 8 operating system, you need to replace yum in this step with dnf; if you are using an Ubuntu system, you need to replace the yum command in this step with apt.

Reinstall the RPM package you need. This operation is performed under normal users.

[<用户名称>@mdw ~]$ sudo yum install -y matrixdb-5.0.0+community-1.el7.x86_64.rpm

2.4 Start the cluster

After the cluster is initialized, go back to the command line and use sudo permissions to connect to the mxadmin user.

[<用户名称>@mdw ~]$ sudo su - mxadmin

Then, use the mxstart tool to start the cluster.

[mxadmin@mdw ~]$ mxstart -a

After the cluster is successfully started, the graphic interface can also be used normally.