Actually this configuration comprise of two parts, first one is call metastore, in which the data structure and definition stored. Another is the so called data stored in HDFS.
Hive treat metastore into RDBMS, here I want to use postgresql.
setup hive to store metadata into postgresql, edit $HIVE_HOME/conf/hive-site.xml
<property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:postgresql://localhost:5432/postgres</value> <description>JDBC connect string for a JDBC metastore</description> </property>
<property> <name>javax.jdo.option.ConnectionDriverName</name> <value>org.postgresql.Driver</value> <description>Driver class name for a JDBC metastore</description> </property>
<property> <name>javax.jdo.option.ConnectionPassword</name> <value>123456</value> <description>password to use against metastore database</description> </property>
<property> <name>hive.metastore.warehouse.dir</name> <value>/user/hive/warehouse</value> <description>location of default database for the warehouse</description> </property>
create related tables in postgresql. This schema file is under $HIVE_HOME/scripts, find the one that fit your requirement.