Quick Installation

This document describes the steps to quickly deploy YMatrix on a single node.

Note!
For deploying a multi-node cluster, refer to the Standard Cluster Deployment section.

Note!
Quick installation is only supported on operating systems such as CentOS 7 and RedHat 7.
For Ubuntu 20.04 deployment instructions, click here;
For CentOS 8 or RedHat 8 deployment instructions, click here;
If system resources are limited and high availability is required, consider using the asymmetric deployment method for rapid cluster setup.

Note!
For instructional video content, see YMatrix Installation and Deployment. If the host cannot access the Internet, refer to Offline Cluster Deployment.

Before installation, please download the YMatrix installer.


1 Server Installation

Server installation consists of two phases: preparation and database deployment. Optional post-installation configurations and basic database management commands are also covered.

1.1 Preparation

1.1.1 Copy the RPM Package

Copy the RPM package from your local machine to the remote server:

~ scp <local path> <username>@<server IP>:<server path>

1.1.2 Install Dependencies

Note!
From this step onward, all operations must be performed as the root user or with sudo privileges.

YMatrix requires Python 3.6. Use the following commands to install it and set Python 3.6 as the default version:

$ sudo yum install centos-release-scl
$ sudo yum install rh-python36
$ sudo scl enable rh-python36 bash

1.1.3 Configure System Settings

Disable the firewall:

$ sudo systemctl stop firewalld.service
$ sudo systemctl disable firewalld.service

Disable SELinux. Edit /etc/selinux/config and set the SELINUX value to disabled:

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

Ensure the installation node has a persistent hostname. If not, use the following command to set one (example sets it to mdw):

$ sudo hostnamectl set-hostname mdw

Edit the /etc/hosts file. If using vim for the first time, install it with the sudo yum install vim command:

$ sudo vim /etc/hosts

Map the hostname to a local network interface address. After editing, press Esc, then type :wq to save and exit:

192.168.100.10 mdw

Note!
Do not duplicate the <IP address> <hostname> entry in /etc/hosts. Doing so may cause a "host network connectivity test failed" error during GUI initialization.

1.2 Database RPM Installation

Install the database RPM package using the yum command as root or with sudo privileges. System dependencies will be installed automatically. By default, YMatrix installs under /opt/ymatrix/matrixdb6:

$ sudo yum install matrixdb6-6.0.0+enterprise_6.0.0-1.el7.x86_64.rpm

Note!
In actual deployment, replace the filename with the latest downloaded RPM package name.

Upon successful installation, the supervisord and MXUI processes start automatically. These background services provide the graphical interface and process management.
If you need to customize ports, modify the /etc/matrixdb6/defaults.conf file after RPM installation. This configuration is only required on the master node (Master).

$ vim /etc/matrixdb6/defaults.conf

1.3 Database Deployment

1.3.1 Graphical Deployment

YMatrix provides an easy-to-use deployment method via GUI or command line. The GUI method is recommended. Remote GUI deployment requires access to ports 8240 and 4617 on the server. The MXUI process provides the web-based interface.

Access the installation wizard using a browser at the following URL, replacing <IP> with the Master server's IP address:

http://<IP>:8240/

On the first page of the wizard, enter the superuser password. You can view the default password using the sudo more /etc/matrixdb6/auth.conf command:

The second page automatically selects "Single Node Deployment". Click Next to proceed:


Proceed with the following three steps for single-node deployment.

Step 1: Set the number of instances, storage paths, and administrator password. Then click "Deploy Now".


Step 2: Deployment begins. The progress is displayed in real time.


Step 3: Completion. After successful deployment, click "Finish".

1.3.2 Command-Line Deployment

YMatrix also supports one-click command-line deployment. Run the following commands. The database starts automatically upon completion and is ready for use:

source /opt/ymatrix/matrixdb6/greenplum_path.sh
sudo env "PATH=$PATH" mxsetup

After deployment, the Cylinder process starts automatically. This process triggers scheduled tasks at specified intervals.

1.4 Post-Installation Configuration (Optional)

SSH into the server and switch to the YMatrix administrator user mxadmin:

$ sudo su - mxadmin

By default, YMatrix allows remote connections. If the "Allow remote connection to database" option was not selected during installation, manually add a line like the following to the $MASTER_DATA_DIRECTORY/pg_hba.conf file to allow any user from any IP to connect with password authentication:

$ host  all       all   0.0.0.0/0  md5

You can restrict the IP range or database names based on security requirements.

To facilitate remote access and verify proper initialization, set a password for the mxadmin user (replace mxpass with your desired password):

$ psql -c "alter role mxadmin with password 'mxpass'" -h localhost -p 5432 mxdb

After making these changes, reload the configuration using the following command:

$ mxstop -u

1.5 Database Management (Optional)

SSH into the server and switch to the YMatrix administrator user mxadmin:

$ sudo su - mxadmin

Use the following commands to manage the database:

$ mxstart -a
$ mxstop -af
$ mxstop -arf 
$ mxstate -s
Command Purpose
mxstop -a Stop the cluster. (Will hang if active sessions exist.)
mxstop -af Forcefully stop the cluster.
mxstop -ar Restart the cluster. Waits for currently running SQL statements to complete. (Will hang if active sessions exist.)
mxstate -s Display cluster status.

2 Minimal Installation

YMatrix can be installed on low-spec hardware with the following minimum requirements:

Minimum Requirements
Dual-core 1GHz CPU
2GB RAM
2GB disk space
RAID 1 (mirroring)

If installing on a device with less than 2GB of RAM, create a swap space of at least 2GB before installation.

Create and enable a 2GB SWAP file:

sudo dd if=/dev/zero of=/opt/swapfile count=2048 bs=1MiB
sudo chmod 600 /opt/swapfile

sudo mkswap /opt/swapfile
sudo swapon /opt/swapfile

swapon -s
free -m

Add the following line to /etc/fstab to make the swap persistent across reboots:

/opt/swapfile   swap    swap    sw  0   0

3 Client Installation

YMatrix is compatible with PostgreSQL 12 protocol. Many commercial and open-source PostgreSQL 12 client tools (such as DBeaver, pgAdmin, etc.) can be used with YMatrix. You can easily connect remotely from personal devices such as laptops. See Client Connection for details.

Select PostgreSQL

The YMatrix command-line tool psql can also be used remotely from Windows or Mac systems. Mac users can install it directly using Homebrew:

$ brew install libpq
$ brew link --force libpq ail

Windows users can download and install from here.

After installing psql, use -h to specify the host and -p to specify the port when connecting to the YMatrix server. Common psql parameters include:

$ psql -h [hostname or IP] -p [port] -U [username] -W -d [database name]

Example:

$ psql -h 127.0.0.1 -p 5432 -U mxadmin -W -d mxdb

Enjoy your experience!