Authenticate PXF to a Kerberized Hadoop cluster using a Kerberos principal and keytab, instead of connecting as an unauthenticated user. This authentication method applies to any Hadoop connector, the Hadoop Distributed File System (HDFS), Hive, or HBase.
Enabling Kerberos authentication
Add these settings to the same server directory you already configured for HDFS, Hive, or HBase.
Note
This procedure requires a Kerberos principal and keytab for PXF, generated with kadmin (MIT Kerberos) or ktpass (Active Directory) on your Kerberos Key Distribution Center (KDC), or provided by your Kerberos administrator.
Copy the
pxf-site.xmltemplate into your server directory:bashcp $PXF_HOME/templates/pxf-site.xml $PXF_BASE/servers/<server_name>Edit
pxf.service.kerberos.principalandpxf.service.kerberos.keytabwith your principal and keytab path:xml<property> <name>pxf.service.kerberos.principal</name> <value>gpadmin/_HOST@EXAMPLE.COM</value> </property> <property> <name>pxf.service.kerberos.keytab</name> <value>${pxf.base}/keytabs/pxf.service.keytab</value> </property>PXF replaces
_HOSTin the principal with each host's fully qualified domain name. See Configuration templates for the full list ofpxf-site.xmlproperties.Copy the keytab file to
$PXF_BASE/keytabson every segment host, at the same path.pxf cluster syncdoesn't distribute this directory, so you need to place it there yourself.Sync the server configuration to every segment host, then restart PXF to apply it:
bashpxf cluster sync pxf cluster restart
To connect to a Kerberized Hive metastore over JDBC instead, set hadoop.security.authentication to kerberos in that server's jdbc-site.xml. See Connecting to SQL databases over JDBC.
Tuning Kerberos parameters
Edit optional properties the same way as Enabling Kerberos authentication above, in that same server's pxf-site.xml, then sync and restart PXF to apply the change:
pxf.service.user.impersonation: By default, PXF impersonates the WarehousePG (WHPG) user running the query when it connects to the external system, so the Hadoop cluster sees requests as coming from that user rather than from PXF's own principal. Set this tofalseto disable impersonation and connect as the PXF principal for every query instead.pxf.service.user.name: Impersonates a specific proxy user rather than the connecting WHPG user. Use this on unsecured clusters where a proxy user is already configured, or to make every WHPG user appear as this one user on the Hadoop side.pxf.service.kerberos.constrained-delegation: Set totrueto impersonate using Kerberos constrained delegation (S4U2Self/Proxy) instead of requiring PXF's principal to be a Hadoop proxy user, for clusters that support it. This delegation mode needs additional configuration on your Active Directory or IPA server.pxf.service.kerberos.ticket-renew-window: The fraction of a Kerberos ticket's lifespan PXF waits through before refreshing it,0.8by default. Set it to0to request a new ticket on every request.
