天天看点

hive本地模式和远程模式

1.内嵌模式,特点是:hive服务和metastore服务运行在同一个进程中,derby服务也运行在该进程中。

该模式无需特殊配置,参见老虎ppt即可。

2.本地模式,特点是:hive服务和metastore服务运行在同一个进程中,mysql是单独的进程,可以在同一台机器上,也可以在远程机器上。

该模式只需将hive-site.xml中的ConnectionURL指向mysql,并配置好驱动名、数据库连接账号即可:

3.远程模式,特点是:hive服务和metastore在不同的进程内,可能是不同的机器。

该模式需要将hive.metastore.local设置为false,并将hive.metastore.uris设置为metastore服务器URI,如有多个metastore服务器,URI之间用逗号分隔。metastore服务器URI的格式为thrift://hostort

<property>
<name>hive.metastore.uris</name>
<value>thrift://127.0.0.1:9083</value>
</property>