6. Configure Hive on HDFS

To use Hive, create the Hive warehouse directory, the Hive and WebHcat user directories, and the WebHCat application folder in HDFS. Then set directory permissions so all users can access them:

  1. Open the command prompt with the hadoop user account:

    runas /user:hadoop cmd 

  2. Make a user directory for hive and the hive warehouse directory:

    %HADOOP_HOME%\bin\hdfs dfs -mkdir -p /user/hive /hive/warehouse

  3. Make a user and application directory for WebHcat:

    %HADOOP_HOME%\bin\hdfs dfs -mkdir -p /user/hcat 
    %HADOOP_HOME%\bin\hdfs dfs -mkdir -p /apps/webhcat

  4. Change the directory owner and permissions:

    %HADOOP_HOME%\bin\hdfs dfs -chown hadoop:hadoop /user/hive
    %HADOOP_HOME%\bin\hdfs dfs -chmod -R 755 /user/hive 
    %HADOOP_HOME%\bin\hdfs dfs -chown -R hadoop:users/hive/warehouse 
    %HADOOP_HOME%\bin\hdfs dfs -chown -R  hadoop:hadoop /user/hcat 
    %HADOOP_HOME%\bin\hdfs dfs -chmod -R 777 /hive/warehouse
    %HADOOP_HOME%\bin\hdfs dfs -chown -R hadoop:users /apps/webhcat
    %HADOOP_HOME%\bin\hdfs dfs -chmod -R 755 /apps/webhcat

loading table of contents...