5. Creating Directories on HDFS

  1. Create the Hive user home directory on HDFS.

    Login as $HDFS_USER and run the following command:

    hdfs dfs -mkdir -p /user/$HIVE_USER
    hdfs dfs -chown $HIVE_USER:$HDFS_USER /user/$HIVE_USER
  2. Create the warehouse directory on HDFS.

    Login as $HDFS_USER and run the following command:

    hdfs dfs -mkdir -p /apps/hive/warehouse
    hdfs dfs -chown -R $HIVE_USER:$HDFS_USER /apps/hive
    hdfs dfs -chmod -R 775 /apps/hive

    Where:

    • $HDFS_USER is the user owning the HDFS services. For example, hdfs.

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

  3. Create the Hive scratch directory on HDFS.

    Login as $HDFS_USER and run the following command:

    hdfs dfs -mkdir -p /tmp/hive
    hdfs dfs -chown -R $HIVE_USER:$HDFS_USER /tmp/hive
    hdfs dfs -chmod -R 777 /tmp/hive

    Where:

    • $HDFS_USER is the user owning the HDFS services. For example, hdfs.

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


loading table of contents...