安装hue及hadoop和hive整合

时间:2023-03-09 21:08:14
安装hue及hadoop和hive整合

环境:

centos7

jdk1.8.0_111

Hadoop 2.7.3

Hive1.2.2

hue-3.10.0

Hue安装:

1.下载hue-3.10.0.tgz:

https://dl.dropboxusercontent.com/u/730827/hue/releases/3.10.0/hue-3.10.0.tgz

2.安装依赖包:

yum install libffi-devel
yum install gmp-devel
yum install python-devel mysql-devel
yum install ant gcc gcc-c++ rsync krb5-devel mysql openssl-devel cyrus-sasl-devel cyrus-sasl-gssapi sqlite-devel openldap-devel python-simplejson
yum install libtidy libxml2-devel libxslt-devel
yum install python-devel python-simplejson python-setuptools
yum install maven

3.编译Hue

tar -xzvf hue-3.10.0.tgz

cd hue-3.10.0

make apps

make install

Hue整合Hadoop:

  HDFS:

  hdfs-site.xml文件配置:

<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>

  core-site.xml文件配置:

<property>
<name>hadoop.proxyuser.hue.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hue.groups</name>
<value>*</value>
</property>

需要把修改过的hdfs-site.xml,core-site.xml文件分发到其他子节点上。

vi hue-3.10.0/desktop/conf/hue.ini

[hadoop]

  [[hdfs_clusters]]

    [[[default]]]

      # Enter the filesystem uri
fs_defaultfs=hdfs://localhost:8020 # Use WebHdfs/HttpFs as the communication mechanism.
# Domain should be the NameNode or HttpFs host.
webhdfs_url=http://localhost:50070/webhdfs/v1

  YARN:

  vi hue-3.10.0/desktop/conf/hue.ini

[hadoop]

  [[yarn_clusters]]

    [[[default]]]

      # Enter the host on which you are running the ResourceManager
resourcemanager_host=localhost # Whether to submit jobs to this cluster
submit_to=True # URL of the ResourceManager API
resourcemanager_api_url=http://localhost:8088 # URL of the ProxyServer API
proxy_api_url=http://localhost:8088 # URL of the HistoryServer API
history_server_api_url=http://localhost:19888

Hue整合Hive:

  vi hue-3.10.0/desktop/conf/hue.ini

[beeswax]

  # Host where HiveServer2 is running.
hive_server_host=localhost # Hive configuration directory, where hive-site.xml is located</span>
hive_conf_dir=/etc/hive/conf

  修改hive-site.xml配置:

<property>
<name>hive.server2.thrift.bind.host</name>
<value>localhost</value>
<description>Bind host on which to run the HiveServer2 Thrift service.</description>
</property>

  启动hive服务:

$ bin/hive --service metastore

  高能预警:matestore服务是Hive连接MySQL的metastore数据库用的。

$ bin/hive --service hiveserver2

  高能预警:hiveserver2服务是通过JDBC访问Hive用的,默认端口是:10000。

启动Hue

  build/env/bin/supervisor

在浏览器访问:http://192.168.187.128:8888打开Hue的Web 界面并登陆

安装hue及hadoop和hive整合

参考:

http://www.opexlabs.com/2016/07/20/compiling-hue-centos-7/

http://gethue.com/how-to-configure-hue-in-your-hadoop-cluster/