HIVE配置postgresql元数据库

1.在hive-0.7.1/conf目录下面hive-site.xml文件里面主要修改

javax.jdo.option.ConnectionURL

javax.jdo.option.ConnectionDriverName

javax.jdo.option.ConnectionUserName

javax.jdo.option.ConnectionPassword

等4个属性。

详细如下:

<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:postgresql://172.16.3.**:****/report?charSet=utf-8</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.ConnectionUserName</name>
  <value>hive</value>
  <description>username to use against metastore database</description>
</property>

<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>hive</value>
  <description>password to use against metastore database</description>
</property>

2.加载postgresql的jar包

将JDBC包(如:postgresql-8.2-504.jdbc3.jar) 复制到hive-0.7.1/lib目录下。

你可能感兴趣的:(hive)