From https://cwiki.apache.org/confluence/display/Hive/GettingStarted
Running Hive
Hive uses Hadoop, so:
- you must have Hadoop in your path OR
- export HADOOP_HOME=
In addition, you must use below HDFS commands to create /tmp and /user/hive/warehouse (aka hive.metastore.warehouse.dir) and set them chmod g+w before you can create a table in Hive.
$ $HADOOP_HOME/bin/hadoop fs -mkdir /tmp
$ $HADOOP_HOME/bin/hadoop fs -mkdir /user/hive/warehouse
$ $HADOOP_HOME/bin/hadoop fs -chmod g+w /tmp
$ $HADOOP_HOME/bin/hadoop fs -chmod g+w /user/hive/warehouse
I can't run the two -mkdir
commands:
$ $HADOOP_HOME/bin/hadoop fs -mkdir /tmp
mkdir: `/tmp': File exists
`/tmp' already exists on my local ext4 file system in my Ubuntu.
$ $HADOOP_HOME/bin/hadoop fs -mkdir /user/hive/warehouse
mkdir: `/user/hive/warehouse': No such file or directory
There is no /usr/hive/warehouse
in my local ext4 file system in my Ubuntu.
So what is the purpose of running -mkdir
to create the two directories?