Configuring the WebHCat Server

About this task

The properties to configure WebHCat are in the following file:
/opt/mapr/hive/hive-<version>/hcatalog/etc/webhcat/webhcat-site.xml

When you set up WebHCat, you can configure MapR File System and Zookeeper as storage.

Procedure

  1. To configure storage for WebHCat, add the MapRFS location property.
    <property> <name>templeton.storage.class</name> <value>org.apache.hive.hcatalog.templeton.tool.HDFSStorage</value> </property> <property> <name>templeton.storage.root</name> <value>/user/mapr/webhcat</value> <description>The path to the directory to use for storage</description> </property>
  2. To configure WebHCat for Pig:
    1. Compress the Pig installation, then move the compressed file to the MapRFS layer.
      # cd /opt/mapr/pig 
      # tar -czvf /tmp/pig-<version>.tar.gz pig-<version>/
      # hadoop fs -mkdir /user/mapr/webhcat
      # hadoop fs -put /tmp/pig-<version>.tar.gz /user/mapr/webhcat/
    2. Set the value of the templeton.pig.archive property to the location of the compressed file.
      <property> <name>templeton.pig.archive</name> <value>maprfs:///user/mapr/webhcat/pig-<version>.tar.gz</value> </property>
    3. Set the value of the templeton.pig.path property to the path inside the compressed Pig file where the Pig binary is located.
      <property>
          <name>templeton.pig.path</name>
          <value>pig-<version>.tar.gz/pig-<version>/bin/pig</value>
      </property>
  3. To configure WebHCat for Hive:
    1. Compress the Hive installation, then move the compressed file to the MapR File System layer.
      # cd /opt/mapr/hive  
      # tar -czvf /tmp/hive-<version>.tar.gz hive-<version>/ 
      # hadoop fs -mkdir /user/mapr/webhcat
      # hadoop fs -put /tmp/hive-<version>.tar.gz /user/mapr/webhcat
    2. Set the value of the templeton.hive.archive property to the location of the compressed file.
      <property> <name>templeton.hive.archive</name> <value>maprfs:///user/mapr/webhcat/hive-<version>.tar.gz</value> </property>
    3. Set the value of the templeton.hive.path property to the path inside the compressed Hive file where the Hive binary is located.
      <property>
           <name>templeton.hive.path</name>
           <value>hive-<version>.tar.gz/hive-<version>/bin/hive</value>
      </property>
  4. To Configure WebHCat for streaming:
    1. Copy the Streaming JAR to the MapR File System layer.
      # hadoop fs -put 
      /opt/mapr/hadoop/hadoop-<version>/contrib/streaming/hadoop-<version>-dev-streaming.jar /user/mapr/webhcat
    2. Set the templeton.streaming.jar property to the location of the streaming JAR.
      <property> <name>templeton.streaming.jar</name> <value>maprfs:///user/mapr/webhcat/hadoop-<version>-dev-streaming.jar</value> </property>