Configuring Apache HDFS Encryption
Also available as:
PDF
loading table of contents...

Configure Hive Tables for HDFS Encryption

Before enabling encryption zones, decide whether to store your Hive tables across one zone or multiple encryption zones.

For a Single Encryption Zone

  1. To configure a single encryption zone for your entire Hive warehouse:
    1. Rename /apps/hive to /apps/hive-old.
    2. Create an encryption zone at /apps/hive.
    3. distcp all of the data from /apps/hive-old to /apps/hive.
  2. To configure the Hive scratch directory (hive.exec.scratchdir) so that it resides inside the encryption zone:
    1. Set the directory to /apps/hive/tmp.
    2. Make sure that the permissions for /apps/hive/tmp are set to 1777.

For multiple Encryption Zones

To access encrypted databases and tables with different encryption keys, configure multiple encryption zones.

For example, to configure two encrypted tables, ez1.db and ez2.db, in two different encryption zones:

  1. Create two new encryption zones, /apps/hive/warehouse/ez1.db and /apps/hive/warehouse/ez2.db.
  2. Load data into Hive tables ez1.db and ez2.db as usual, using LOAD statements. (For additional considerations, see "Loading Data into an Encrypted Table.")