Hive Structure
Metastore 服务和存储的方式
1.内嵌模式
2.本地模式
3.远程模式
建议采取远程模式,这样的模式可以将数据库层完全置于防火墙后,客户就不再需要用户名和密码登录数据库,避免了认证信息的泄漏。
配置信息 hive 1.1.0
服务端配置:
属性 |
默认值
|
描述
|
hive.metastore.uris |
远端模式下Metastore的URI列表
| |
javax.jdo.option.ConnectionURL |
metastore数据库的JDBC URL
| |
javax.jdo.option.ConnectionDriverName |
com.mysql.jdbc.Driver
|
JDBC驱动类
|
javax.jdo.option.ConnectionUserName |
hive
|
JDBC用户名
|
javax.jdo.option.ConnectionPassword |
***
|
JDBC密码
|
客户端配置:
属性 |
默认值
|
描述
|
hive.metastore.uris |
远端模式下Metastore的URI列表
| |
hive.metastore.local | false | Metastore is remote. Note: This is no longer needed as of Hive 0.10. Settinghive.metastore.uri is sufficient. |
1.10 测试的过程中发现hive.metastore.local 不设置也没关系, 主要根据uris 来进行判断。
注意:在测试的过程中发现设置uris 的port 为其他值没有效果(hive.metastore.port Hive 1.3.0 and later 加入)
对于hivemetastore 服务 可以将配置放到hivemetastore-site.xml 中,加载顺序 hive-site.xml --> hive-metastore.xml --> -hiveconf ,后面加载的生效。
参考资料:https://cwiki.apache.org/confluence/display/Hive/AdminManual+MetastoreAdmin
https://cwiki.apache.org/confluence/display/Hive/AdminManual+Configuration