6. Upgrade Hive and HCatalog

  1. Stop the Hive Metastore service, if you have not done so already.


    Make sure that the Hive metastore database is running.

  2. Upgrade Hive and HCatalog. On the Hive and HCatalog host machines, execute the following commands:

    • For RHEL/CentOS:

      yum upgrade hive
      yum erase hcatalog
      yum install hive-hcatalog 
    • For SLES:

      Run the following commands:

      zypper rm hive hcatalog
      zypper install hive-hcatalog
      zypper install bigtop-tomcat

    • For Ubuntu or Debian:

      apt-get update hive hcatalog

  3. Upgrade the Hive Metastore database schema.

    $HIVE_HOME/bin/schematool -upgradeSchema -dbType <$databaseType> 

    The value for $databaseType can be derby, mysql, oracle, or postgres.

  4. Download and extract the HDP companion files. Copy the hive-site.xml file in the configuration_files/hive directory of the extracted companion files to the etc/hive/conf directory on your Hive host machine. This new version of the hive-site.xml file contains new properties for HDP-2.1 features.

  5. Edit the hive-site.xml file and modify the properties based on your environment. Search for TODO in the file for the properties to replace.

    1. Edit the connection properities for your Hive metastore database in hive-site.xml:

          <description>Enter your Hive Metastore Connection URL, for example if MySQL: jdbc:mysql://localhost:3306/mysql?createDatabaseIfNotExist=true</description>    
          <description>Enter your Hive Metastore database user name.</description>
         <description>Enter your Hive Metastore database password.</description>
        <description>Enter your Hive Metastore Connection Driver Name, for example if MySQL: com.mysql.jdbc.Driver</description>

      Optional: If you want Hive Authorization, set the following Hive authorization parameters in the hive-site.xml file:


      For a remote Hive metastore database, use the following hive-site.xml property value to set the IP address (or fully-qualified domain name) and port of the metastore host. To enable HiveServer2, leave this property value empty.

       <description>URI for client to contact metastore server. To enable HiveServer2, leave the property value empty. </description>


    You can also use the HDP utility script to fine-tune your configuration settings based on node hardware specifications.

  6. Disable autocreation of schemas to match HDP 2.1 configurations.

    Edit hive-site.xml to set the value of datanucleus.autoCreateSchema to false.

      <description>Creates necessary schema on a startup if one doesn't exist.</description>
  7. Start Hive. On the Hive Metastore host machine, execute the following command:

    sudo su -l $HIVE_USER -c "nohup hive --service metastore > $HIVE_LOG_DIR/hive.out 2> $HIVE_LOG_DIR/hive.log &"                   
  8. Start Hive Server2. On the Hive Server2 host machine, execute the following command:

    sudo su -l $HIVE_USER -c "nohup /usr/lib/hive/bin/hiveserver2 -hiveconf hive.metastore.uris=\" \" > $HIVE_LOG_DIR/hiveserver2.out 2> $HIVE_LOG_DIR/hiveserver2.log &"                 


    • $HIVE_USER is the Hive Service user. For example, hive.

    • $HIVE_LOG_DIR is the directory where Hive server logs are stored (example: /var/log/hive).

loading table of contents...