Get a Kerberos Ticket

You must perform the recommended steps if you use Kerberos; otherwise, you can skip these steps.

  1. Become the Hive service user.
    For example, on Linux:
    $ kinit -kt /etc/security/keytabs/hive.service.keytab hive/`hostname -f`
  2. If you see the following error, modify the pre-upgrade tool command to include -Djavax.security.auth.useSubjectCredsOnly=false. The error is: org.ietf.jgss.GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt.
    For example, in step 4 of the procedure in Preparing Hive for upgrade, modify the pre-upgrade tool command as follows:
    $ $JAVA_HOME/bin/java -cp /usr/hdp/$STACK_VERSION/hive/lib/derby-10.10.2.0.jar:/usr/hdp/$STACK_VERSION/hive/lib/*:/usr/hdp/$STACK_VERSION/hadoop/*:/usr/hdp/$STACK_VERSION/hadoop/lib/*:/usr/hdp/$STACK_VERSION/hadoop-mapreduce/*:/usr/hdp/$STACK_VERSION/hadoop-mapreduce/lib/*:/usr/hdp/$STACK_VERSION/hadoop-hdfs/*:/usr/hdp/$STACK_VERSION/hadoop-hdfs/lib/*:/usr/hdp/$STACK_VERSION/hadoop/etc/hadoop/*:/tmp/hive-pre-upgrade-3.1.0.3.1.0.258-3.jar:/usr/hdp/$STACK_VERSION/hive/conf/conf.server:/etc/hadoop/conf/:/etc/hive/conf/ org.apache.hadoop.hive.upgrade.acid.PreUpgradeTool > {hive_log_dir}/pre_upgrade_{target_version}.log
    For more information, see Oracle Basic client server.
  3. Perform the procedure for compacting Hive tables that follows.