Offline installation means that the cluster host cannot access the external network and cannot download the installation package from the external network using the yum command.

MatrixDB 4 can be installed on operating systems that support the x86_64 platform: Red Hat 7, CentOS 7; and on operating systems that support the ARM 64 platform: Galaxy Kirin V10.

Notes!
Domestic platforms such as Kirin system are only supported in enterprise features, and the installation steps of this document are not applicable. If you need it, please contact the pre-sales staff: [email protected].

This document describes the steps to quickly deploy a MatrixDB 4 cluster on multiple servers. Taking three nodes as an example, the primary node is mdw and the two data nodes are sdw1 and sdw2 respectively.

Please refer to [MatrixDB Installation and Deployment] (https://www.bilibili.com/video/BV1Jf4y1b7Ef/)

Notes!
This tutorial is limited to 64-bit installation packages. If you need a 32-bit installation package, please prepare it yourself.

Notes!
The MatrixDB installation environment must support at least Haswell and above Intel processor architectures, or Excavator and above AMD processor architectures.

Server installation

The server installation process includes 6 steps: viewing the basic server information, installation preparation, database RPM package installation, Python dependency package installation, database initialization and post-installation settings.

1 View basic server information

Before performing the installation operation, check the basic server information first. Undoubtedly, this is a good habit, and understanding a server will help you plan and deploy the cluster better.

Step Commands *Purpose**
1 free -g View operating system memory information
2 lscpu View CPU quantity
3 cat /etc/system-release View operating system version information
4 uname -a Output all kernel information in the following order (where the detection results of -p and -i are omitted if they are agnostic): kernel name; host name on network node; kernel issue number; kernel version; host hardware architecture name; processor type (not portable); hardware platform or (not portable); operating system name
5 tail -11 /proc/cpuinfo View CPU information

2 Installation preparation

2.1 Create a local yum repository

The MatrixDB installer needs to rely on other resource packages and provides dependencies by creating a local yum repository:

First download the offline warehouse compression package from the official website: matrixdb_local_repo.tar. Copy the compressed package to On all nodes, unzip the installation package and run create_repo.sh with the root user:

tar xf matrixdb_local_repo.tar
cd matrixdb_local_repo
sh create_repo.sh

After successful execution, execute yum repolist to view the yum repository and confirm that the installation is successful:

[root@localhost matrixdb_local_repo]# yum repolist
repo id                                  repo name                                   status
base/7/x86_64                            CentOS-7 - Base                             0
extras/7/x86_64                          CentOS-7 - Extras                           0
updates/7/x86_64                         CentOS-7 - Updates                          0
ymatrix                                  ymatrix                                     0
repolist: 95

See that ymatrix has taken effect.

2.2 Modify the machine configuration

Turn off the firewall:

systemctl stop firewalld.service
systemctl disable firewalld.service

Close SELinux, edit /etc/selinux/config, and set the value of SELINUX to disabled:

sed s/^SELINUX=.*$/SELINUX=disabled/ -i /etc/selinux/config
setenforce 0

Make sure that there are persistent host names on all nodes. If they do not exist, please use the following command to set the host name. For example, you can set it in the master node like this:

hostnamectl set-hostname mdw

The two child nodes also set corresponding host names:

hostnamectl set-hostname sdw1
hostnamectl set-hostname sdw2

Ensure that all nodes in the cluster can access each other through hostname and IP. Add a record in /etc/hosts and map the host name to a local network card address. For example, /etc/hosts of the three nodes contain something like this:

192.168.100.10 mdw
192.168.100.11 sdw1
192.168.100.12 sdw2

3 Database RPM package installation

On all nodes, use the root user to execute the following yum command to install the database RPM package and specify the local repository. The system dependency library will be installed automatically. By default, it will be installed in the /usr/local/matrixdb directory:

yum install --disablerepo=* --enablerepo=ymatrix matrixdb-4.0.0-1.el7.x86_64.rpm

Note: During the actual installation process, please replace the file name with the latest downloaded RPM package name

After the installation is successful, the supervisord, cylinder, and mxui processes will be automatically started. These background processes are used to provide graphical operation interfaces, manage and control clusters, etc.

4 Install Python dependency package

Download Python offline dependency package from the official website: pip.dep.tar

On all nodes, use the root user to execute the following command to install the Python package that MatrixDB depends on. Note that source greenplum_path.sh must be executed so that the correct version of the dependency package can be installed:

source /usr/local/matrixdb/greenplum_path.sh
yum install --disablerepo=* --enablerepo=ymatrix python3-devel
tar xf pip.dep.tar
pip3 install pip.dep/*.whl

5 Database Deployment

The graphical deployment provided by MatrixDB is still used here. Remote graphical deployment requires server ports 8240 and 4617 to be accessible. After the installation is complete, these ports of all nodes will be opened by default.

Use your browser to access the following graphical installation wizard URL, which is the IP of the mdw server:

http://<IP>:8240/

On the first page of the installation wizard, you need to fill in the superuser password, which can be found in /etc/matrixdb/auth.conf: Fill in the password

On the second page, select "Add multiple nodes and initialize the database cluster" and click Next: Select to add multiple nodes and initialize the database cluster


Next, start the five-step operation of multi-machine deployment.

The first step is to add a node. Enter the IP address, host name, or FQDN of the node in the upper right text box and click "Add Node": Add node

After adding sdw1 and sdw2, click "Next" Complete the addition of node

At this time, the interconnection test between the hosts will be carried out to ensure that the network between the hosts is connected. Internet Test


The second step is to configure the database and select the database directory storage path and the number of segments. The system automatically recommends the largest space of disks and the number of segments matching the system resources, which can be adjusted according to the specific usage scenario. "Enable automatic data mirroring" determines whether the cluster data node contains backup images. It is recommended to check it in the production environment so that the cluster is highly available. After confirming, click "Next": Configure Database


Step 3: Set the password. MatrixDB creates an mxadmin database administrator account and serves as a super account. In this link, set the password for the mxadmin account and click "Next" (the password for the database account is set here, not the password for the operating system account). In addition, there is another option that is "Allow remote connection to the database", which is checked by default: Set Password


Step 4: Confirm the deployment. This step will list the configuration parameters for the previous operation. After confirming that it is correct, click "Execute deployment": Confirm deployment

Then, the system will automatically deploy the cluster and list the detailed steps and execution progress. After all the steps are successfully executed, it means that the deployment is completed: Deployment Progress

At this time, you can see the basic methods of managing the database and how to set up allowing remote connections. To confirm that the database cluster is successfully deployed and accessible, you can click "Test Connection": Complete Details

When you see a prompt for a successful connection, it means that the cluster can receive user requests normally: Test Connection

6 Settings after installation

MatrixDB default installation supports remote connections. If "Allow remote connection to database" is not checked during the installation process, please manually modify the $MASTER_DATA_DIRECTORY/pg_hba.conf file to add a line like this, indicating that users from any IP who access all databases are allowed to connect through password authentication. The IP range or database name can be limited according to actual needs to be used to reduce security risks:

host  all       all   0.0.0.0/0  md5

After completing these modifications, you need to execute the following command to reload the pg_hba.conf configuration file:

gpstop -u

MatrixDB start, stop, restart and status viewing can be completed by the following commands:

gpstart -a
gpstop -af
gpstop -arf
gpstate
Command Purpose
gpstop -a Stop the cluster. (In this mode, if there is a session link, closing the database will be stuck)
gpstop -af Quickly shut down the cluster
gpstop -ar Restart the cluster. Wait for the currently executing SQL statement to end (in this mode, if there is a session link, closing the database will be stuck)
gpstate -s View cluster status