6. Upgrade WebHCat (Templeton)

  1. Remove old Templeton packages. On the Templeton host machine, execute the following commands:

    • For RHEL/CentOS:

      yum remove templeton\* 
                          
    • For SLES:

      zypper remove templeton\* 
                          
  2. Install WebHCat.

    • For RHEL/CentOS:

      yum install webhcat-tar-hive webhcat-tar-pig
    • For SLES:

      zypper install webhcat-tar-hive webhcat-tar-pig 

    Also see the instructions on manually deploying WebHCat instance provided here.

  3. Create PID and Log directories.

     mkdir -p $WEBHCAT_PID_DIR $WEBHCAT_LOG_DIR
     chown -R hcat:users $WEBHCAT_LOG_DIR $WEBHCAT_LOG_DIR 
                    

    where $WEBHCAT_LOG_DIR is the directory where the WebHCat log files will be stored (for example: /var/log/webhcat) and the $WEBHCAT_PID_DIR is where the WebHCat PID file will be stored (for example: /var/run/webhcat).

  4. Create the /usr/lib/hcatalog/conf/webhcat-env.sh file with the following contents:

     # The file containing the running pid
    PID_FILE=$WEBHCAT_PID_DIR/webhcat.pid
    
    WEBHCAT_LOG_DIR=$WEBHCAT_LOG_DIR
    
    # The console error log
    ERROR_LOG=$WEBHCAT_LOG_DIR/webhcat-console-error.log
    
    # The console log
    CONSOLE_LOG=$WEBHCAT_LOG_DIR/webhcat-console.log
    
    # Set HADOOP_HOME to point to a specific hadoop install directory
    HADOOP_HOME=${HADOOP_HOME:-/usr/lib/hadoop}
    
    # set hadoop HADOOP_CLIENT_OPTS so that hadoop does not override it
    export HADOOP_CLIENT_OPTS="-Xmx256m $HADOOP_CLIENT_OPTS" 
                    

    Default value of $HADOOP_CLIENT_OPTS can be found in /etc/hadoop/conf/hadoop-env.sh but can be overridden by exporting HADOOP_CLIENT_OPTS externally.

  5. Copy the file /etc/templeton/templeton-site.xml.rpmsave to /usr/lib/hcatalog/conf/webhcat-site.xml and change the following properties:

    Table 5.1. Configuration Properties
    Property Name Value
    templeton.jar /usr/lib/hcatalog/share/webhcat/svr/webhcat.jar
    templeton.pig.archive hdfs:///apps/webhcat/pig.tar.gz
    templeton.pig.path pig.tar.gz/pig-0.10.1.21/bin/pig
    templeton.hive.archive hdfs:///apps/webhcat/hive.tar.gz
    templeton.hive.path hive.tar.gz/hive-0.10.0.21/bin/hive
    templeton.hive.properties Add the following string at the end of the existing value: ,hive.metastore.execute.setugi=true
    templeton.streaming.jar hdfs:///apps/webhcatalog/hadoop-streaming.jar

  6. Prepare WebHCat directories on HDFS. On the WebHCat host machine, execute the following command:

    sudo su -l hdfs -c "hadoop dfs -mkdir /user/hcat"
    sudo su -l hdfs -c "hadoop dfs -chown -R hcat:hcat /user/hcat"
    sudo su -l hdfs -c "hadoop dfs -mkdir /apps/webhcat"
    sudo su -l hdfs -c "hadoop dfs -copyFromLocal /usr/share/HDP-webhcat/pig.tar.gz /apps/webhcat/"
    sudo su -l hdfs -c "hadoop dfs -copyFromLocal /usr/share/HDP-webhcat/hive.tar.gz /apps/webhcat/"
    sudo su -l hdfs -c "hadoop dfs -copyFromLocal /usr/lib/hadoop/contrib/streaming/hadoop-streaming*.jar /apps/webhcat/"
    sudo su -l hdfs -c "hadoop dfs -chown -R hcat:users /apps/webhcat"
    sudo su -l hdfs -c "hadoop dfs -chmod -R 755 /apps/webhcat"
    
                    

  7. Start WebHCat. On the WebHCat host machine, execute the following command:

    sudo su -l hcat -c "/usr/lib/hcatalog/sbin/webhcat_server.sh start"
                    

  8. Smoke test WebHCat. On the WebHCat host machine, execute the following command:

     http://$WEBHCAT_HOST_MACHINE:50111/templeton/v1/status 

  9. Remove shared libraries from old Templeton installation. On the WebHCat host machine, execute the following command:

    sudo su -l hdfs -c "hadoop dfs -rmr -skipTrash /apps/templeton"
    rm -rf /usr/share/HDP-templeton 
                        


loading table of contents...