简介
配置完hive之后,就可以配置使用spark来利用hive的数据引擎做计算
配置hive-site.xml
此时配置的hive-site.xml,不是hive下的hive-site.xml,而是spark的hive-site.xml。在conf下vim一个新文件hive-site.xml,输入以下内容:
vim hive-site.xml
输入配置内容:
<configuration>
<property>
<name>hive.metastore.uris</name>
<value>thrift://master:9083</value>
</property>
</configuration>
使用hive元数据仓库作为spark的数据引擎
启动hive的metastore
配置完hive-site.xml之后去连接hive,其实是无法连接,因为metastore没有启动,因此需要在hive的bin目录下去启动metastore
hive –service metastore
启动后会停滞在界面上,其实metastore已经启动了,这时在用spark-shell去使用hive,发现已经可以正常使用了