3. Set Up the Hive/HCatalog Configuration Files

There are several configuration files that need to be set up for Hive/HCatalog.

In the temporary directory, locate the following file and modify the properties based on your environment. Search for TODO in the files for the properties to replace.

Use the following instructions to set up the Hive/HCatalog configuration files:

  1. Extract the Hive/HCatalog configuration files.

    From the downloaded scripts.zip file, extract the files in configuration_files/hive directory to a temporary directory.

  2. Modify the configuration files.

    In the temporary directory, locate the following file and modify the properties based on your environment. Search for TODO in the files for the properties to replace.

    1. Edit hive-site.xml and modify the following properties:

      <property>     
       <name>javax.jdo.option.ConnectionURL</name>     
       <value></value>
       <description>Enter your JDBC connection string. 
                       For MySQL database: jdbc:mysql://$mysql.full.hostname:3306/$database.name?createDatabaseIfNotExist=true
                       For Oracle database: jdbc:oracle:thin:@$dbhost:1521/$hive_dbname </description>
      </property>
      
      <property>     
       <name>javax.jdo.option.ConnectionDriverName</name>     
       <value></value>
       <description>JDBC Connection Driver Name. 
                       For MySQL database: com.mysql.jdbc.Driver
                       For Oracle database: oracle.jdbc.driver.OracleDriver 
      </property>
      <property>     
       <name>javax.jdo.option.ConnectionUserName</name>     
       <value>$dbusername</value>
       <description>Enter your MySQL credentials. </description>
      </property>
      <property>     
       <name>javax.jdo.option.ConnectionPassword</name>     
       <value>$dbuserpassword</value>
       <description>Enter your MySQL credentials. </description>
      </property>
      <property>     
       <name>hive.metastore.uris</name>     
       <value>thrift://$metastore.server.full.hostname:9083</value>
       <description>URI for client to contact metastore server. To enable HiveServer2, leave the property value empty. </description>
      </property>
      

  3. Copy the configuration files.

    1. On all Hive hosts create the Hive configuration directory.

      rm -r $HIVE_CONF_DIR ;
      mkdir -p $HIVE_CONF_DIR ;
    2. Copy all the configuration files to $HIVE_CONF_DIR directory.

    3. Set appropriate permissions:

      chown -R $HIVE_USER:$HADOOP_GROUP $HIVE_CONF_DIR/../ ;
      chmod -R 755 $HIVE_CONF_DIR/../ ;

    where:

    • $HIVE_CONF_DIR is the directory to store the Hive configuration files. For example, /etc/hive/conf.

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

    • $HADOOP_GROUP is a common group shared by services. For example, hadoop.


loading table of contents...