PXF Installation

Platform Extension Framework (PXF) uses the mechanism of Foreign Data Wrapper (FDW) to access data stored in an external source of the YMatrix database.

  • PXF requires a running environment for Java 8 or Java 11 and requires the environment variable $JAVA_HOME to be set.
  • The default installation path of PXF RPM is /usr/local/pxf-matrixdb3.
  • All machines in the cluster need to be installed and configured with PXF.

Notes!
The PXF feature is only supported in Enterprise Edition. If you need it, please contact: [email protected].

The installation steps are as follows:

1 Installation

Notes!
This step needs to be performed on all nodes using a root user or a normal user with sudo permissions.

Install the RPM package.

$ sudo yum install pxf-matrixdb3-5.16.0-1.el7.x86_64.rpm

2 Configure environment variables

Notes!
This step needs to be performed on all nodes using a root user or a normal user with sudo permissions.

Configure environment variables.

$ sudo vim /etc/profile

export PXF_HOME=/usr/local/pxf-matrixdb3
export PXF_CONF=/usr/local/pxfconf
export PATH=$PXF_HOME/bin:$PATH

Notes!
Starting from PXF 6.0, the environment variable PXF_CONF was renamed to PXF_BASE, and if this variable is not specified, the configuration file in PXF_HOME is used.

Refresh environment variables.

$ source /etc/profile

3 Change the $PXF_HOME file permissions

Notes!
This step needs to be performed on all nodes using a root user or a normal user with sudo permissions.

Change the owner and group permissions of the $PXF_HOME file to mxadmin.

$ sudo chown -R mxadmin:mxadmin $PXF_HOME

4 Initialize PXF

After ensuring that the cluster is started, execute under the mxadmin user of Master:

$ pxf cluster init

As shown below, the PXF configuration file has been initialized successfully.

Initializing PXF on master host and 2 segment hosts...
PXF initialized successfully on 3 out of 3 hosts

Notes!
Starting with PXF 6.0, the init option is deprecated and replaced with the prepare option.

5 Synchronize PXF configuration files from Master to all segments

First, install rsync under all nodes** using root user or ordinary users with sudo permissions.

$ sudo yum install -y rsync

In Master, use the mxadmin user to execute the following commands to synchronize the PXF configuration file to all nodes of the cluster.

$ pxf cluster sync

As shown below, the PXF configuration file has been synchronized successfully.

Syncing PXF configuration files from master host to 2 segment hosts...
PXF configs synced successfully on 2 out of 2 hosts

Notes!
You need to check the corresponding directories of other nodes to check whether their configuration files are synchronized successfully.

6 Start PXF

In Master, use the mxadmin user to execute the following command to start the PXF service.

$ pxf cluster start

As shown below, it is stated that PXF is started successfully.

Starting PXF on 2 segment hosts...
PXF started successfully on 2 out of 2 hosts

7 Detect PXF status

In Master, use the mxadmin user to execute the following command to detect the PXF status.

$ pxf cluster status

Confirm that the PXF cluster starts successfully.

Checking status of PXF servers on 2 segment hosts...
PXF is running on 2 out of 2 hosts

8 Start separately on Master

The PXF instance needs to be started separately using the mxadmin user on the Master of the YMatrix cluster.

$ pxf start

As shown below, it means that PXF has been started successfully. The path of the PXF-related log file is /usr/local/pxfconf/logs. If an error is reported during use, you can go to the corresponding directory to view the log.

Using CATALINA_BASE:   /usr/local/pxf-matrixdb3/pxf-service
Using CATALINA_HOME:   /usr/local/pxf-matrixdb3/pxf-service
Using CATALINA_TMPDIR: /usr/local/pxf-matrixdb3/pxf-service/temp
Using JRE_HOME:        /data/jdk1.8.0_151/jre
Using CLASSPATH:       /usr/local/pxf-matrixdb3/pxf-service/bin/bootstrap.jar:/usr/local/pxf-matrixdb3/pxf-service/bin/tomcat-juli.jar
Using CATALINA_PID:    /usr/local/pxf-matrixdb3/run/catalina.pid
Existing PID file found during start.
Removing/clearing stale PID file.
Tomcat started.
Checking if tomcat is up and running...
Server: PXF Server
Checking if PXF webapp is up and running...
PXF webapp is listening on port 5888