HUE学习笔记(二)——Hue编译安装

Hue 官方网站: https://gethue.com/ HUE 官方用户手册: https://docs.gethue.com/ 官方安装文档: https://docs.gethue.com/administrator/installation/install/ HUE 下载地址: https://docs.gethue.com/releases/   注意   安装 Hue 的节点上最好没有安装过 MySQL,否则可能有版本冲突   1、解压缩  
yum install unzip   unzip hue-release-4.3.0.zip

2、安装依赖

需要Python支持(Python 2.7+ / Python 3.5+)   python --version   在 CentOS 系统中安装编译 Hue 需要的依赖库   yum install ant asciidoc cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-plain gcc gcc-c ++ krb5-devel libffi-devel libxml2- devel libxslt-devel make mysql mysql-devel openldap-devel python-devel sqlite-devel gmp-devel   yum install -y rsync
3、安装Maven   4、编译  
进入 hue 源码目录,进行编译。 使用 PREFIX 指定安装 Hue 的路径   cd /opt/lagou/software/hue-release-4.3.0   PREFIX=/opt/lagou/servers make install   cd /opt/lagou/servers
5、修改 Hadoop 配置文件   注意   先关闭HDFS集群  
[root@linux101 hadoop-2.9.2]# stop-dfs.sh
 
  5.1 hdfs-site.xml 中增加配置  
[root@linux101 hadoop]# pwd
/opt/lagou/servers/hadoop-2.9.2/etc/hadoop
[root@linux101 hadoop]# vi  hdfs-site.xml

<!-- HUE -->
<property>
        <name>dfs.webhdfs.enabled</name>
        <value>true</value>
</property>

<property>
        <name>dfs.permissions.enabled</name>
        <value>false</value>
</property>

5.2 core-site.xml 中增加配置  
<!-- HUE -->
<property>
        <name>hadoop.proxyuser.hue.hosts</name>
        <value>*</value>
</property>
<property>
        <name>hadoop.proxyuser.hue.groups</name>
        <value>*</value>
</property>
<property>
        <name>hadoop.proxyuser.hdfs.hosts</name>
        <value>*</value>
</property>
<property>
        <name>hadoop.proxyuser.hdfs.groups</name>
        <value>*</value>
</property>
 
5.3 httpfs-site.xml  
<configuration>
        <!-- HUE -->
        <property>
                <name>httpfs.proxyuser.hue.hosts</name>
                <value>*</value>
        </property>
        <property>
                <name>httpfs.proxyuser.hue.groups</name>
                <value>*</value>
        </property>
</configuration>
 
5.4 修改完 HDFS 相关配置后,需要把配置 scp 给集群中每台机器,重启 hdfs  

[root@linux101 hadoop]# scp core-site.xml linux102:$PWD
core-site.xml                                                                                       100% 1444     1.4MB/s   00:00    
[root@linux101 hadoop]# scp core-site.xml linux103:$PWD
core-site.xml                                                                                       100% 1444     1.8MB/s   00:00    
[root@linux101 hadoop]# scp hdfs-site.xml linux103:$PWD
hdfs-site.xml                                                                                       100% 1228     1.5MB/s   00:00    
[root@linux101 hadoop]# scp hdfs-site.xml linux102:$PWD
hdfs-site.xml                                                                                       100% 1228     1.6MB/s   00:00    
[root@linux101 hadoop]# scp  httpfs-site.xml linux102:$PWD
httpfs-site.xml                                                                                     100%  806   410.1KB/s   00:00    
[root@linux101 hadoop]# scp  httpfs-site.xml linux103:$PWD
httpfs-site.xml                                                                                     100%  806   386.7KB/s   00:00    
[root@linux101 hadoop]# start-dfs.sh 

6、Hue配置

cd /opt/lagou/servers/hue/desktop/conf

cp pseudo-distributed.ini.tmpl pseudo-distributed.ini vi pseudo-distributed.ini

     33   http_host=192.168.2.129
     34   http_port=8000 
     37   is_hue_4=true
     50   time_zone=Aisa/Shanghai

     56   dev=true
     94   server_user=hue
     95   server_group=hue

    98   default_user=hue

    212   app_blacklist=search

    640     engine=mysql
    641     host=192.168.2.128
    642     port=3306
    643     user=hive
    644     password=w5623009
    645     name=hue

   1006    hadoop_conf_dir=/opt/lagou/servers/hadoop-2.9.2/etc/hadoop

在mysql中创建数据库hue,用来存放元数据 mysql -u hive -p mysql> create database hue;   初始化数据库 [root@linux102 bin]# pwd
/opt/lagou/servers/hue/build/env/bin [root@linux102 bin]# ./hue syncdb [root@linux102 bin]# ./hue migrate   启动服务 [root@linux102 bin]# ./supervisor
启动报错 KeyError: "Couldn't get user id for user hue" [root@linux102 hue]# pwd
/opt/lagou/servers/hue [root@linux102 hue]# useradd hue;   再次启动成功  

6.1 验证

在浏览器中输入http://192.168.2.129:8000/

第一次访问的时候,需要设置超级管理员用户和密码。记住它 (hue/123456)
上一篇:HDFS的高可用性HA配置实战


下一篇:各搜索引擎高级搜索备忘