Hive记录-使用Hue管理Hive元数据

时间:2024-01-15 08:38:50

Hue是一个开源的Apache Hadoop UI系统,由Cloudera Desktop演化而来,最后Cloudera公司将其贡献给Apache基金会的Hadoop社区,它是基于Python Web框架Django实现的。通过使用Hue我们可以在浏览器端的Web控制台上与Hadoop集群进行交互来分析处理数据,例如操作HDFS上的数据,运行MapReduce Job,执行Hive的SQL语句,浏览HBase数据库等等。
     Hue在数据库方面,默认使用的是SQLite数据库来管理自身的数据,包括用户认证和授权,另外,可以自定义为MySQL数据库、Postgresql数据库、以及Oracle数据库。其自身的功能包含有:
对HDFS的访问,通过浏览器来查阅HDFS的数据。
Hive编辑器:可以编写HQL和运行HQL脚本,以及查看运行结果等相关Hive功能。
提供Solr搜索应用,并对应相应的可视化数据视图以及DashBoard。
提供Impala的应用进行数据交互查询。
最新的版本集成了Spark编辑器和DashBoard
支持Pig编辑器,并能够运行编写的脚本任务。
Oozie调度器,可以通过DashBoard来提交和监控Workflow、Coordinator以及Bundle。
支持HBase对数据的查询修改以及可视化。
支持对Metastore的浏览,可以访问Hive的元数据以及对应的HCatalog。
另外,还有对Job的支持,Sqoop,ZooKeeper以及DB(MySQL,SQLite,Oracle等)的支持。

1.安装依赖项

ant
asciidoc
cyrus-sasl-devel
cyrus-sasl-gssapi
gcc
gcc-c++
krb5-devel
libtidy (for unit tests only)
libxml2-devel
libxslt-devel
make
mvn (from maven package or maven3 tarball)
mysql
mysql-devel
openldap-devel
python-devel
sqlite-devel
openssl-devel (for version 7+)
gmp-devel

2.安装hadoop/hbase/hive/zookeeper等

3.官网http://gethue.com下载安装包上传到LINUX服务器上去,解压,进入目录执行make apps,也可以make install安装到/usr/local下

4.修改desktop/conf/pseudo-distributed.ini/hue.ini---按项目实际情况进行配置

[desktop]
# hue webServer 地址和端口号
http_host=192.168.66.66
http_port=8001 # Webserver runs as this user
server_user=hue
server_group=hue # This should be the Hue admin and proxy user
default_user=hue # This should be the hadoop cluster admin
default_hdfs_superuser=root [hadoop]
fs_defaultfs=hdfs://xinfang:9000
webhdfs_url=http://192.168.66.66:50070/webhdfs/v1/
hadoop_conf_dir=/usr/app/hadoop/etc/hadoop [[yarn_clusters]]
# Enter the host on which you are running the ResourceManager
resourcemanager_host=192.168.66.66 # The port where the ResourceManager IPC listens on
resourcemanager_port=8032 # Whether to submit jobs to this cluster
submit_to=True # URL of the ResourceManager API
resourcemanager_api_url=http://192.168.66.66:8088 # URL of the ProxyServer API
proxy_api_url=http://192.168.66.66:8088 # URL of the HistoryServer API
history_server_api_url=http://192.168.66.66:19888 [beeswax]
# If Kerberos security is enabled, use fully-qualified domain name (FQDN).
hive_server_host=192.168.66.66 # Port where HiveServer2 Thrift server runs on.
hive_server_port=10000 # Hive configuration directory, where hive-site.xml is located
hive_conf_dir=/usr/app/hive/conf [zookeeper]
host_ports=192.168.66.66:2181
  [[[mysql]]]
   engine=mysql
      # IP or hostname of the database to connect to.
      host=192.168.66.66
      # 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=1

#adduser hue    ---添加用户

#chmod -R 777 /usr/app/hue-4.0.0  ---授权

5.执行build/env/bin/supervisor

6.  浏览器输入:http://192.168.66.66:8001,创建用户和密码登录即可