Install PXF on every host in your WarehousePG (WHPG) cluster, including the coordinator, standby coordinator, and all segment hosts. To move to a newer PXF version later, see Upgrading PXF.
Prerequisites
- WarehousePG installed on every host in the cluster, running on RHEL 7 (WHPG 6.x only), 8, or 9.
- Java 8 or 11 installed on every host in the cluster.
Installing PXF
Install the PXF package on the coordinator, standby coordinator, and all segment hosts. Run these steps as gpadmin on the coordinator.
On the coordinator, download the package from the EDB repository:
export EDB_SUBSCRIPTION_TOKEN=<your-token> curl -1sSLf "https://downloads.enterprisedb.com/$EDB_SUBSCRIPTION_TOKEN/gpsupp/setup.rpm.sh" | sudo -E bash sudo dnf download edb-whpg<whpg_major_version>-pxf-<version>
export EDB_SUBSCRIPTION_TOKEN=<your-token> curl -1sSLf "https://downloads.enterprisedb.com/$EDB_SUBSCRIPTION_TOKEN/gpsupp/setup.rpm.sh" | sudo -E bash sudo yumdownloader edb-whpg<whpg_major_version>-pxf-<version>
Where
<whpg_major_version>is your WHPG version,6or7, and<version>includes the package release number, for example6.10.3-1.Create a file
all_hostslisting the coordinator, standby coordinator, and all segment hosts:cdw scdw sdw1 sdw2 sdw3
If you haven't already, install Java on every host. For example, to install Java 8:
gpssh -f all_hosts -u gpadmin -e "sudo dnf -y install java-1.8.0-openjdk-devel"
gpssh -f all_hosts -u gpadmin -e "sudo yum -y install java-1.8.0-openjdk-devel"
Copy the package to all hosts in the WHPG cluster, replacing
<el_version>with your OS version:gpsync -f all_hosts edb-whpg7-pxf-<version>.<el_version>.x86_64.rpm =:/tmp/
gpscp -f all_hosts edb-whpg6-pxf-<version>.<el_version>.x86_64.rpm =:/tmp/
Install the package on all hosts:
gpssh -f all_hosts -u gpadmin -e "sudo dnf install -y /tmp/edb-whpg<whpg_major_version>-pxf-<version>.<el_version>.x86_64.rpm"
gpssh -f all_hosts -u gpadmin -e "sudo yum install -y /tmp/edb-whpg<whpg_major_version>-pxf-<version>.<el_version>.x86_64.rpm"
The installation creates
/usr/local/edb-whpg<whpg_major_version>-pxf. You'll set this variable as the$PXF_HOMEenvironment variable when Configuring and starting PXF.Set ownership of
$PXF_HOMEon every host, sogpadmincan run PXF:gpssh -f all_hosts -u gpadmin -e "sudo chown -R gpadmin:gpadmin /usr/local/edb-whpg<whpg_major_version>-pxf"
Upgrading PXF
Upgrade PXF by installing the new package over the existing one on every host. Because $PXF_BASE is separate from $PXF_HOME, your configuration and server definitions stay in place. Run these steps as gpadmin on the coordinator.
Record your current PXF version:
pxf version
Back up
$PXF_BASEon every host, so you can restore your configuration if needed. Each host holds its own copy of files thatpxf cluster syncdoesn't distribute, such as the keytabs:gpssh -f all_hosts -e "cp -a $PXF_BASE $PXF_BASE.bak.$(date +%Y%m%d)"
To restore, replace
$PXF_BASEwith the$PXF_BASE.bak.<date>backup on each host.Download the new package and copy it to every host, as described in the download and copy steps of Installing PXF.
Upgrade the package on all hosts:
gpssh -f all_hosts -u gpadmin -e "sudo rpm -Uvh /tmp/edb-whpg<whpg_major_version>-pxf-<version>.<el_version>.x86_64.rpm"
For example, the package file for PXF 6.10.3 on WHPG 7 and RHEL 8 is
edb-whpg7-pxf-6.10.3-1.el8.x86_64.rpm.Restart PXF on every host and check its status. The package upgrade replaces the files on disk, but each host keeps serving the old version until you restart it:
pxf cluster restart pxf cluster status
Confirm that every host runs the new version.
pxf versionreports only the version of thepxfcommand on the host where you run it, so query the running service on each host instead:gpssh -f all_hosts -e "curl -s http://localhost:5888/actuator/info"
In each database that uses PXF, update the extension:
ALTER EXTENSION pxf UPDATE;
On WHPG 7, if you use the foreign data wrapper, also update the
pxf_fdwextension:ALTER EXTENSION pxf_fdw UPDATE;
Upgrading WarehousePG
When you upgrade WHPG in place, the PXF files in $GPHOME stay in place and PXF keeps working, so you don't need to register PXF again.
Next steps
See Configuring and starting PXF to set up and start the PXF service across your cluster. If you plan to query through pxf_fdw instead of pxf:// external tables, see Using the foreign data wrapper for its own package requirements.