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.
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:
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_CONF
setting in your PXF 5.x PXF installation; you will need this later. If you are unsure of the location, you can find the value in pxf-env-default.sh
.
Stop PXF on each Greenplum host as described in Stopping PXF.
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.
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 pxf
commands specified in subsequent steps using the binaries from your PXF 6.x installation. Ensure that the PXF 6.x installation bin/
directory is in your $PATH
, or provide the full path to the pxf
command. You can run the following command to check the pxf
version:
gpadmin@coordinator$ pxf version
(Optional, Advanced) If you want to relocate $PXF_BASE
outside 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
:
$PXF_CONF
setting.Run the migrate
command (see pxf cluster migrate). You must provide PXF_CONF
. If you relocated $PXF_BASE
, provide that setting as well.
gpadmin@coordinator$ PXF_CONF=/path/to/dir pxf cluster migrate
Or:
gpadmin@coordinator$ PXF_CONF=/path/to/dir PXF_BASE=/new/dir pxf cluster migrate
The command copies PXF 5.x conf/pxf-profiles.xml
, servers/*
, lib/*
, and keytabs/*
to the PXF 6.x $PXF_BASE
directory. The command also merges configuration changes in the PXF 5.x conf/pxf-env.sh
into the PXF 6.x file of the same name and into pxf-application.properties
.
migrate
command does not migrate PXF 5.x $PXF_CONF/conf/pxf-log4j.properties
customizations; you must manually migrate any changes that you made to this file to $PXF_BASE/conf/pxf-log4j2.xml
. Note that PXF 5.x pxf-log4j.properties
is in properties format, and PXF 6 pxf-log4j2.xml
is xml
format. See the Configuration with XML topic in the Apache Log4j 2 documentation for more information.If you migrated your PXF 6.x $PXF_BASE
configuration (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.authentication
property to the jdbc-site.xml
file to explicitly identify use of the Kerberos authentication method. Perform the following for each of these server configs:
Open the jdbc-site.xml
file 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>
If you are upgrading from PXF version 5.11.x or earlier: The PXF Hive
and HiveRC
profiles (named hive
and hive:rc
in 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 Hive
or HiveRC
profile.
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:
pxf.service.user.name
property in the pxf-site.xml
template file is now commented out by default. Keep this in mind when you configure new PXF servers.jdbc.pool.property.maximumPoolSize
property is now 15
. 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’s jdbc-site.xml
file.CREATE EXTERNAL TABLE
LOCATION
clause 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
, or HiveORC
profiles (named hive
, hive:rc
, and hive:orc
in 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:
&PPD=false
option in the LOCATION
clause.(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 the pxf.ppd.hive
property in the pxf-site.xml
file to false
:
<property>
<name>pxf.ppd.hive</name>
<value>false</value>
</property>
You may need to add this property block to the pxf-site.xml
file.
Register the PXF 6.x extension files with Greenplum Database (see pxf cluster register). $GPHOME
must be set when you run this command.
gpadmin@coordinator$ pxf cluster register
The register
command copies only the pxf.control
extension file to the Greenplum cluster. In PXF 6.x, the PXF extension .sql
file and library pxf.so
reside 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 pxf
extension. 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 the psql
subsystem 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 here |
jdbc.user.impersonation property |
pxf.service.user.impersonation property in the jdbc‑site.xml server configuration file |
PXF_KEYTAB configuration property |
pxf.service.kerberos.keytab property in the pxf‑site.xml server configuration file |
PXF_PRINCIPAL configuration property |
pxf.service.kerberos.principal property in the pxf‑site.xml server configuration file |
PXF_USER_IMPERSONATION configuration property |
pxf.service.user.impersonation property 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 new pxf-hbase-<version>.jar
with Hadoop and HBase as follows:
<PXF_INSTALL_DIR>/share/pxf-hbase-<version>.jar
to each node in your HBase cluster.$HBASE_CLASSPATH
on each HBase node.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.