CentOS6安装大数据软件(七):Hue大数据可视化工具安装和配置

目录

0. 相关文章链接

1. Hue概述和版本选择

2. Hue安装

2.1. 上传压缩包并进行解压缩

2.2. 增加hue用户

2.3. 修改hue安装目录的权限

2.4. 安装hue需要的依赖

2.5. 编译hue

3. Hue基本配置和启动

3.1. 配置hue.ini

3.2. 修改权限和启动服务

3.3. 查看Hue的WEB界面

4. Hue和HDFS集成

4.1. 修改HDFS的2个配置文件

4.1.1. 修改hdfs-site.xml配置文件

4.1.2. 修改core-site.xml配置文件

4.2. 将修改的配置文件分发到其他节点

4.3. 重新启动HDFS到其他节点

4.4. 配置hue.ini

4.5. 重新启动hue

4.6. 在hue的web界面管理HDFS

5. Hue和YARN集成

6. Hue和Hive集成

6.1. 配置hue.ini

6.2. 修改tmp权限

6.3. 启动服务

7. Hue和MySQL集成

8. Hue和HBase集成


0. 相关文章链接

CentOS6安装大数据软件(一):Linux基础软件的安装

CentOS6安装大数据软件(二):Hadoop分布式集群配置

CentOS6安装大数据软件(三):Kafka集群的配置

CentOS6安装大数据软件(四):HBase分布式集群的配置

CentOS6安装大数据软件(五):Flume安装与配置

CentOS6安装大数据软件(六):Hive安装和配置

CentOS6安装大数据软件(七):Hue大数据可视化工具安装和配置

CentOS6安装大数据软件(八):Spark集群安装和部署

CentOS6安装大数据软件(九):大数据及相关软件启动等命令

1. Hue概述和版本选择

Hue是一个开源的Apache Hadoop UI系统,最早是由Cloudera Desktop演化而来,由Cloudera贡献给开源社区,它是基于Python Web框架Django实现的.通过使用Hue我们可以再浏览器端的Web控制台上与Hadoop集群进行交互来分析处理数据,例如操作HDFS上的数据,运行MapReduce程序.等等。

官网:http://gethue.com/

CDH版本:http://archive-primary.cloudera.com/cdh5/cdh/5/

本次我们采用的是CDH版本,版本号为hue-3.7.0-cdh5.3.6.tar.gz

2. Hue安装

2.1. 上传压缩包并进行解压缩

tar -zxvf hue-3.7.0-cdh5.3.6.tar.gz -C /export/servers/

2.2. 增加hue用户

因为hue的默认用户不是使用root用户,所以需要增加hue用户,并设置好hue用户的密码(默认使用123456)。
#新增hue用户
useradd hue
#给hue用户设置密码(默认为123456)(输入如下命令,点击回车,再输入密码即可)
passwd hue

2.3. 修改hue安装目录的权限

chown -R hue:hue hue-3.7.0-cdh5.3.6/

2.4. 安装hue需要的依赖

#Red-Hat(CentOS相当于Red-Hat)安装依赖如下所示
yum install -y gcc gcc-c++ libxml2-devel libxslt-devel cyrus-sasl-devel cyrus-sasl-gssapi mysql-devel python-devel python-setuptools python-simplejson sqlite-devel ant libsasl2-dev libsasl2-modules-gssapi-mit libkrb5-dev libtidy-0.99-0 mvn openldap-dev libldap2-dev openldap-devel

依赖参考:http://archive-primary.cloudera.com/cdh5/cdh/5/hue-3.7.0-cdh5.3.6/manual.html

相关依赖列表如下表所示:

2.5. 编译hue

切换成hue用户,并到hue的顶层安装目录下 执行如下命令:

make apps

显示如下结果为编译成功:

3. Hue基本配置和启动

3.1. 配置hue.ini

在/export/servers/hue-3.7.0-cdh5.3.6/desktop/conf目录下配置hue.ini
参照官网:http://archive-primary.cloudera.com/cdh5/cdh/5/hue-3.7.0-cdh5.3.6/manual.html#_configuring_hue的3.1章节
在hue.ini配置文件中配置秘钥,访问的ip地址和端口号,时区:
secret_key=jFE93j;2[290-eiw.KEiwN2s3['d;/.q[eIW^y#e=+Iei*@Mn<qW5o

# Webserver listens on this address and port
http_host=spark-node01.ouyang.com
http_port=8888

# Time zone name
time_zone=Asia/Shanghai

3.2. 修改权限和启动服务

请检查desktop目录下的desktop.db文件和desktop/conf目录下的hue.ini文件是否为hue用户组的hue用户,如果不是,请修改。

#修改desktop目录下的desktop.pb目录的权限

chmod o+w /opt/modules/hue-3.7.0-cdh5.3.6/desktop/desktop.db

#在build目录下启动hue服务

build/env/bin/supervisor

3.3. 查看Hue的WEB界面

访问地址:node01.ouyang.com:8888

第一次访问,会让创建一个用户,这个用户是超级用户,拥有的权限比较多

登录成功后即可进入hue主页面:

4. Hue和HDFS集成

4.1. 修改HDFS的2个配置文件

4.1.1. 修改hdfs-site.xml配置文件

# 该配置文件路径:/export/servers/hadoop-2.7.4/etc/Hadoop
# 在该文件中添加如下内容:
<!--开启webhdfs-->
<property>
    <name>dfs.webhdfs.enabled</name>
    <value>true</value>
</property>

4.1.2. 修改core-site.xml配置文件

# 该配置文件路径:/export/servers/hadoop-2.7.4/etc/Hadoop
# 在该文件中添加如下内容:
<!--开启添加hue用户和用户组的信息-->
<property>
  <name>hadoop.proxyuser.hue.hosts</name>
  <value>*</value>
</property>
<property>
  <name>hadoop.proxyuser.hue.groups</name>
  <value>*</value>
</property>

4.2. 将修改的配置文件分发到其他节点

scp core-site.xml node02.ouyang.com:$PWD
scp core-site.xml node03.ouyang.com:$PWD
scp hdfs-site.xml node02.ouyang.com:$PWD
scp hdfs-site.xml node03.ouyang.com:$PWD

4.3. 重新启动HDFS到其他节点

这里执行hadoop的一键停止和启动功能

4.4. 配置hue.ini

在[[hdfs_clusters]]标签下进行hdfs的配置:

[[hdfs_clusters]]
    # HA support by using HttpFs

    [[[default]]]
      # Enter the filesystem uri
      fs_defaultfs=hdfs://node01.ouyang.com:9000

      # NameNode logical name.
      ## logical_name=

      # Use WebHdfs/HttpFs as the communication mechanism.
      # Domain should be the NameNode or HttpFs host.
      # Default port is 14000 for HttpFs.
      webhdfs_url=http://node01.ouyang.com:50070/webhdfs/v1

      # Change this if your HDFS cluster is Kerberos-secured
      ## security_enabled=false

      # Default umask for file and directory creation, specified in an octal value.
      ## umask=022

      # Directory of the Hadoop configuration
      hadoop_conf_dir= /export/servers/hadoop-2.7.4/etc/hadoop
      hadoop_hdfs_home= /export/servers/hadoop-2.7.4
      hadoop_bin= /export/servers/hadoop-2.7.4/bin

  # Configuration for YARN (MR2)

4.5. 重新启动hue

./build/env/bin/supervisor

4.6. 在hue的web界面管理HDFS

在该界面里可以正常查看HDFS的文件夹和文件,还可以对文件的内容进行查看,但根据上述配置还不能对文件进行编辑。

5. Hue和YARN集成

在[[yarn_clusters]]标签下进行yarn的配置:

[[yarn_clusters]]

    [[[default]]]
      # Enter the host on which you are running the ResourceManager
      resourcemanager_host=node01.ouyang.com

      # The port where the ResourceManager IPC listens on
      resourcemanager_port=8032

      # Whether to submit jobs to this cluster
      submit_to=True

      # Resource Manager logical name (required for HA)
      ## logical_name=

      # Change this if your YARN cluster is Kerberos-secured
      ## security_enabled=false

      # URL of the ResourceManager API
      resourcemanager_api_url=http://node01.ouyang.com:8088

      # URL of the ProxyServer API
      proxy_api_url=http://node01.ouyang.com:8088

      # URL of the HistoryServer API
      history_server_api_url=http://node01.ouyang.com:19888

      # In secure mode (HTTPS), if SSL certificates from Resource Manager's
      # Rest Server have to be verified against certificate authority
      ## ssl_cert_ca_verify=False

修改配置文件后重新启动yarn和hue服务。

当我们将YARN服务启动之后,重新刷新Hue的WEB UI界面,就可以看到这条警告没有了。

6. Hue和Hive集成

6.1. 配置hue.ini

在[beeswax]标签下进行Hive的配置:

[beeswax]

  # Host where HiveServer2 is running.
  # If Kerberos security is enabled, use fully-qualified domain name (FQDN).
  hive_server_host=node01.ouyang.com

  # Port where HiveServer2 Thrift server runs on.
  hive_server_port=10000

  # Hive configuration directory, where hive-site.xml is located
  hive_conf_dir=/export/servers/hive/conf
  hive_home_dir=/export/servers/hive

  # Timeout in seconds for thrift calls to Hive service
  ## server_conn_timeout=120

6.2. 修改tmp权限

因为hive服务的根文件保存在hdfs的/tmp目录下,而该目录只有root的执行权限,但hue是使用hue用户启动的,使用需要将/tmp目录修改成hue用户可以执行的权限。

hdfs dfs -chmod 777 /tmp

6.3. 启动服务

重新启动hue服务

启动hive服务

因为有些hive表依赖HBase,使用也启动HBase服务

7. Hue和MySQL集成

在hue.ini配置文件的[[databases]]标签下修改MySQL的配置

# mysql, oracle, or postgresql configuration.
    [[[mysql]]]
      # Name to show in the UI.
      nice_name="My SQL DB"

      # For MySQL and PostgreSQL, name is the name of the database.
      # For Oracle, Name is instance of the Oracle server. For express edition
      # this is 'xe' by default.
      name=mysql

      # Database backend to use. This can be:
      # 1. mysql
      # 2. postgresql
      # 3. oracle
      engine=mysql

      # IP or hostname of the database to connect to.
      host=node01.ouyang.com

      # Port the database server is listening to. Defaults are:
      # 1. MySQL: 3306
      # 2. PostgreSQL: 5432
      # 3. Oracle Express Edition: 1521
      port=3306

      # Username to authenticate with when connecting to the database.
      user=root

      # Password matching the username to authenticate with when
      # connecting to the database.
      password=root

重新启动hue,即可在hue的web界面进行MySQL数据库的操作。

8. Hue和HBase集成

在hue.ini配置文件的[[hbase]]标签下修改MySQL的配置

[hbase]
  # Comma-separated list of HBase Thrift servers for clusters in the format of '(name|host:port)'.
  # Use full hostname with security.
  hbase_clusters=(Cluster|node01.ouyang.com:9090)

  # HBase configuration directory, where hbase-site.xml is located.
  hbase_conf_dir=/export/servers/hbase/conf

配置完成后需重启hue服务和启动上述ip地址下的HBase的thriftserver服务。

bin/hbase-daemon.sh start thrift

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

电光闪烁

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值