大數據學習第四篇之Hue集成Hive

接上篇文章繼續share,我把名字更改成了大數據篇,不說了直接幹活。

一、配置Hue訪問Hive

1. 修改/opt/hue/hue-4.3.0/desktop/conf/hue.ini,找到[beeswax]位置,填寫配置信息,如下

[beeswax]
# Host where HiveServer2 is running.
# If Kerberos security is enabled, use fully-qualified domain name (FQDN).
hive_server_host=sosvsmshadoop4.ps.shanghaionstar.com
# Port where HiveServer2 Thrift server runs on.
hive_server_port=10001
# Hive configuration directory, where hive-site.xml is located
hive_conf_dir=/etc/hive/conf

配置好後重啓Hue即可

2. 在Hive授權hue用戶可以訪問的數據庫,登錄hive

sudo su - hive
hive
> show databases;
> grant all on database default to use hue;
# 如果需要授權多個數據庫將上面語句中的default換成其他的database名字即可。

3. 如果在Hue UI上出現Cannot access: /user/hive/warehouse的錯誤,是因爲安裝時自動將hivesite.
xml裏的hive.metastore.warehouse.dir修改成了/warehouse/tablespace/managed/hive導致
的,如下:

<property>
   <name>hive.metastore.warehouse.dir</name>
   <value>/warehouse/tablespace/managed/hive</value>
</property>

我們只需要把上面這段配置加入到Hue所在機器的/etc/hive/conf/hive-site.xml文件中即可解決,
另如果重啓了Hive,也需要重啓Hue纔行。
如果安裝hue的機器上沒有hive的配置文件,需要將hive的配置文件從安裝hive的機器上拷貝到安
裝hue的機器上,路徑爲/etc/hive/conf

End

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章