Upgrading from Version 5.x
If you have installed, configured, and are using PXF 5.x in your Greenplum Database 5 or 6 cluster, you must perform some upgrade actions when you install PXF 6.x.
If you are using PXF with Greenplum Database 5, you must upgrade Greenplum to version 5.21.2 or newer before you upgrade to PXF 6.x.
The PXF upgrade procedure has three steps. You perform one pre-install procedure, the install itself, and then a post-install procedure to upgrade to PXF 6.x:
- Step 1: Perform the PXF Pre-Upgrade Actions
- Step 2: Install PXF 6.x
- Step 3: Complete the Upgrade to PXF 6.x
Step 1: Performing the PXF Pre-Upgrade Actions
Perform this procedure before you upgrade to a new version of PXF:
-
Log in to the Greenplum Database coordinator host. For example:
$ ssh gpadmin@<coordinator> -
Identify and note the version of PXF currently running in your Greenplum cluster:
gpadmin@coordinator$ pxf version -
Identify the file system location of the
$PXF_CONFsetting in your PXF 5.x PXF installation; you will need this later. If you are unsure of the location, you can find the value inpxf-env-default.sh. -
Stop PXF on each Greenplum host as described in Stopping PXF.
Step 2: Installing PXF 6.x
-
Install PXF 6.x and identify and note the new PXF version number.
-
Check out the new installation layout in About the PXF Installation and Configuration Directories.
Step 3: Completing the Upgrade to PXF 6.x
After you install the new version of PXF, perform the following procedure:
-
Log in to the Greenplum Database coordinator host. For example:
$ ssh gpadmin@<coordinator> -
You must run the
pxfcommands specified in subsequent steps using the binaries from your PXF 6.x installation. Ensure that the PXF 6.x installationbin/directory is in your$PATH, or provide the full path to thepxfcommand. You can run the following command to check thepxfversion:gpadmin@coordinator$ pxf version -
(Optional, Advanced) If you want to relocate
$PXF_BASEoutside of<PXF_INSTALL_DIR>, perform the procedure described in Relocating $PXF_BASE. -
Auto-migrate your PXF 5.x configuration to PXF 6.x
$PXF_BASE:-
Recall your PXF 5.x
$PXF_CONFsetting. -
Run the
migratecommand (see pxf cluster migrate). You must providePXF_CONF. If you relocated$PXF_BASE, provide that setting as well.gpadmin@coordinator$ PXF_CONF=/path/to/dir pxf cluster migrateOr:
gpadmin@coordinator$ PXF_CONF=/path/to/dir PXF_BASE=/new/dir pxf cluster migrateThe command copies PXF 5.x
conf/pxf-profiles.xml,servers/*,lib/*, andkeytabs/*to the PXF 6.x$PXF_BASEdirectory. The command also merges configuration changes in the PXF 5.xconf/pxf-env.shinto the PXF 6.x file of the same name and intopxf-application.properties. -
The
migratecommand does not migrate PXF 5.x$PXF_CONF/conf/pxf-log4j.propertiescustomizations; you must manually migrate any changes that you made to this file to$PXF_BASE/conf/pxf-log4j2.xml. Note that PXF 5.xpxf-log4j.propertiesis in properties format, and PXF 6pxf-log4j2.xmlisxmlformat. See the Configuration with XML topic in the Apache Log4j 2 documentation for more information.
-
-
If you migrated your PXF 6.x
$PXF_BASEconfiguration (see previous step), be sure to apply any changes identified in subsequent steps to the new, migrated directory. -
If you are upgrading from PXF version 5.9.x or earlier and you have configured any JDBC servers that access Kerberos-secured Hive, you must now set the
hadoop.security.authenticationproperty to thejdbc-site.xmlfile to explicitly identify use of the Kerberos authentication method. Perform the following for each of these server configs:-
Navigate to the server configuration directory.
-
Open the
jdbc-site.xmlfile in the editor of your choice and uncomment or add the following property block to the file:<property>
<name>hadoop.security.authentication</name>
<value>kerberos</value>
</property> -
Save the file and exit the editor.
-
-
If you are upgrading from PXF version 5.11.x or earlier: The PXF
HiveandHiveRCprofiles (namedhiveandhive:rcin PXF version 6.x) now support column projection using column name-based mapping. If you have any existing PXF external tables that specify one of these profiles, and the external table relied on column index-based mapping, you may be required to drop and recreate the tables:-
Identify all PXF external tables that you created that specify a
HiveorHiveRCprofile. -
For each external table that you identify in step 1, examine the definitions of both the PXF external table and the referenced Hive table. If the column names of the PXF external table do not match the column names of the Hive table:
-
Drop the existing PXF external table. For example:
DROP EXTERNAL TABLE pxf_hive_table1; -
Recreate the PXF external table using the Hive column names. For example:
CREATE EXTERNAL TABLE pxf_hive_table1( hivecolname int, hivecolname2 text )
LOCATION( 'pxf://default.hive_table_name?PROFILE=hive')
FORMAT 'custom' (FORMATTER='pxfwritable_import'); -
Review any SQL scripts that you may have created that reference the PXF external table, and update column names if required.
-
-
-
If you are upgrading from PXF version 5.15.x or earlier:
-
The
pxf.service.user.nameproperty in thepxf-site.xmltemplate file is now commented out by default. Keep this in mind when you configure new PXF servers. -
The default value for the
jdbc.pool.property.maximumPoolSizeproperty is now15. If you have previously configured a JDBC server and want that server to use the new default value, you must manually change the property value in the server'sjdbc-site.xmlfile. -
PXF 5.16 disallows specifying relative paths and environment variables in the
CREATE EXTERNAL TABLELOCATIONclause file path. If you previously created any external tables that specified a relative path or environment variable, you must drop each external table, and then re-create it without these constructs. -
Filter pushdown is activated by default for queries on external tables that specify the
Hive,HiveRC, orHiveORCprofiles (namedhive,hive:rc, andhive:orcin PXF version 6.x). If you have previously created an external table that specifies one of these profiles and queries are failing with PXF v5.16+, you can deactivate filter pushdown at the external table-level or at the server level:-
(External table) Drop the external table and re-create it, specifying the
&PPD=falseoption in theLOCATIONclause. -
(Server) If you do not want to recreate the external table, you can deactivate filter pushdown for all
Hive*(named as described here in PXF version 6.x) profile queries using the server by setting thepxf.ppd.hiveproperty in thepxf-site.xmlfile tofalse:<property>
<name>pxf.ppd.hive</name>
<value>false</value>
</property>You may need to add this property block to the
pxf-site.xmlfile.
-
-
-
Register the PXF 6.x extension files with Greenplum Database (see pxf cluster register).
$GPHOMEmust be set when you run this command.gpadmin@coordinator$ pxf cluster registerThe
registercommand copies only thepxf.controlextension file to the Greenplum cluster. In PXF 6.x, the PXF extension.sqlfile and librarypxf.soreside in<PXF_INSTALL_DIR>/gpextable. You may choose to remove these now-unused files from the Greenplum Database installation on the Greenplum Database coordinator host, the standby coordinator host, and all segment hosts. For example, to remove the files on the coordinator host:gpadmin@coordinator$ rm $GPHOME/share/postgresql/extension/pxf--1.0.sql
gpadmin@coordinator$ rm $GPHOME/lib/postgresql/pxf.so -
PXF 6.x includes a new version of the
pxfextension. You must update the extension in every Greenplum database in which you are using PXF. A database superuser or the database owner must run this SQL command in thepsqlsubsystem or in an SQL script:ALTER EXTENSION pxf UPDATE; -
Ensure that you no longer reference previously-deprecated features that were removed in PXF 6.0:
Deprecated Feature Use Instead Hadoop profile names hdfs:<profile>as noted herejdbc.user.impersonationpropertypxf.service.user.impersonationproperty in the jdbc‑site.xml server configuration filePXF_KEYTABconfiguration propertypxf.service.kerberos.keytabproperty in the pxf‑site.xml server configuration filePXF_PRINCIPALconfiguration propertypxf.service.kerberos.principalproperty in the pxf‑site.xml server configuration filePXF_USER_IMPERSONATIONconfiguration propertypxf.service.user.impersonationproperty in the pxf‑site.xml server configuration file -
PXF 6.x distributes a single JAR file that includes all of its dependencies, and separately makes its HBase JAR file available in
<PXF_INSTALL_DIR>/share. If you have configured a PXF Hadoop server for HBase access, you must register the newpxf-hbase-<version>.jarwith Hadoop and HBase as follows:- Copy
<PXF_INSTALL_DIR>/share/pxf-hbase-<version>.jarto each node in your HBase cluster. - Add the location of this JAR to
$HBASE_CLASSPATHon each HBase node. - Restart HBase on each node.
- Copy
-
In PXF 6.x, the PXF Service runs on all Greenplum Database hosts. If you used PXF 5.x to access Kerberos-secured HDFS, you must now generate principals and keytabs for the Greenplum coordinator and standby coordinator hosts, and distribute these to the hosts as described in Configuring PXF for Secure HDFS.
-
Synchronize the PXF 6.x configuration from the coordinator host to the standby coordinator host and each Greenplum Database segment host. For example:
gpadmin@coordinator$ pxf cluster sync -
Start PXF on each Greenplum host. For example:
gpadmin@coordinator$ pxf cluster start -
Verify that PXF can access each external data source by querying external tables that specify each PXF server configuration.