Skip to content

Managing the PXF cluster

Once PXF is running, you manage it from the coordinator host using the pxf cluster commands.

Understanding PXF directories and configuration files

PXF uses two main directories:

  • $PXF_HOME is the read-only directory where PXF is installed, for example /usr/local/pxf. It holds the PXF service itself, along with the connector site templates under templates/ that you copy into a server configuration.
  • $PXF_BASE is the writable runtime directory you create when you initialize your cluster, for example $HOME/pxf-base. It holds your configuration, including your server configurations under servers/. Keeping $PXF_BASE separate from $PXF_HOME means a PXF upgrade doesn't overwrite your configuration.

See Connecting to external data for how PXF servers and profiles work.

Relocating $PXF_BASE

Move $PXF_BASE to a new location if you're running low on disk space or reorganizing storage across hosts:

  1. Stop PXF on every host:

    bash
    pxf cluster stop
  2. On the coordinator, move $PXF_BASE to the new location and update the environment variable, including in ~/.bashrc:

    bash
    mv $PXF_BASE /new/path/to/pxf-base
    export PXF_BASE=/new/path/to/pxf-base
  3. Sync the relocated directory out to every segment host, then start PXF:

    bash
    pxf cluster sync
    pxf cluster start
  4. Once PXF is confirmed running from the new location, clean up the old $PXF_BASE directory on each segment host.

Starting, stopping, and restarting PXF

Start, stop, or restart PXF across the whole cluster with a single command, rather than repeating it on every host. Only the gpadmin user can run these commands:

bash
pxf cluster start
pxf cluster stop
pxf cluster restart

Applying a configuration change

Sync any change to a file under $PXF_BASE/conf, or to a server configuration, out to every segment host, then restart PXF. For example, to increase the PXF Java heap size:

  1. Edit PXF_JVM_OPTS in $PXF_BASE/conf/pxf-env.sh on the coordinator:

    bash
    export PXF_JVM_OPTS="-Xmx4g -Xms2g"
  2. Sync the change to every segment host:

    bash
    pxf cluster sync
  3. Restart PXF to apply it. Changes made only on the coordinator have no effect until you sync and restart:

    bash
    pxf cluster restart

Configuring advanced settings

Adjust settings under $PXF_BASE/conf to fit your environment, the same way as any other configuration change:

  • Change the listen address, overall log level, or thread limit by editing pxf-application.properties.
  • Change the JVM heap size by editing pxf-env.sh.
  • Set the hostname or port WHPG uses to reach PXF by setting the PXF_HOST and PXF_PORT environment variables in ~/.bashrc on the relevant host. This change also requires restarting WHPG itself, not just PXF.
  • Fine-tune logging for individual loggers by editing pxf-log4j2.xml.
  • Define a custom PXF profile in pxf-profiles.xml, pairing a profile name with Java classes that implement PXF's plugin interfaces to read or write it.

See PXF configuration files for the full list of properties in each file.

Monitoring PXF

pxf cluster status confirms PXF is both running and responsive on every host:

bash
pxf cluster status

PXF also exposes HTTP endpoints on each host for monitoring tools, at http://<host>:5888/<endpoint>:

EndpointDescription
actuator/healthThe status of the PXF service.
actuator/infoBuild information for the PXF service.
actuator/metricsJVM, Tomcat, system, and PXF-specific metrics.
actuator/prometheusThe same metrics, in a format a Prometheus server can scrape.