说明:大数据集群是cdh版本的,由cloudera-manager管理,由于hue和cm版本的造成了Hue的hive历史查询不能下载,所以在集群之外重新安装了Hue
Hue的安装
1:下载安装包
去官网直接下载,因为之前的hql历史查询记录不能下载,所以选择另一个版本
2:安装依赖
sudo yum install ant asciidoc cyrus-sasl-devel cyrus-sasl-gssapi gcc gcc-c++ krb5-devel libtidy libxml2-devel libxslt-devel openldap-devel python-devel python-simplejson sqlite-devel gmp-devel -y
3:编译Hue
进入hue目录下执行make apps进行编译
在编译的时候有可能会报错,一般都是依赖没有安装完全,根据提示安装依赖即可
4:修改配置文件
基础配置,打开desktop/conf/hue.ini文件
#Set this to a random string, the longer the better
#This is used for secure hashing in the session store.
#在此说明一下,下面这个值不能为空,作用是提高安全性,可以设置任意英文
secret_key=jFE93j;2[290-eiw.KEiwN2s3[‘d;/.q[eIW^y#e=+Iei*@Mn<qW5o
#Webserver listens on this address and port
http_host=192.168.6.94
http_port=8888
#Time zone name
time_zone=Asia/Shanghai
#Enable or disable Django debug mode.
django_debug_mode=false
#Enable or disable backtrace for server error
http_500_debug_mode=false
5:启动hue,进行测试
./build/env/bin/supervisor
在网页输入http://192.168.6.94:8888,如果能显示页面则表示成功,如果报错(没有截图),最后一句为:Database.Cursor.execute(self, query, params) OperationalError: attempt to write a readonly database。这是因为权限的问题,执行sudo chown -R hue:hue /home/apps/hue即可。
6:hue与hdfs集成
进入目录:cd /opt/cloudera/parcels/CDH-5.14.0-1.cdh5.14.0.p0.24/lib/hadoop/etc/hadoop
(1)更改hadoop的hdfs-site.xml 文件
配置启动HDFS中的webHDFS
vim hdfs-site.xml 增加:
修改hue.ini
配置hdfs
# Enter the filesystem uri
fs_defaultfs=hdfs://192.168.6.94:8020
# 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://192.168.6.94:50070/webhdfs/v1
hadoop_conf_dir=/opt/cloudera/parcels/CDH-5.14.0-1.cdh5.14.0.p0.24/lib/hadoop/etc/hadoop
配置yarn
[[yarn_clusters]]
[[[default]]]
# Enter the host on which you are running the ResourceManager
resourcemanager_host=192.168.6.94
#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.6.94:8088
# URL of the ProxyServer API
proxy_api_url=http://192.168.6.94:8088
# URL of the HistoryServer API
history_server_api_url=http://192.168.6.94:19888
配置databases
[[database]]
# Database engine is typically one of:
# postgresql_psycopg2, mysql, sqlite3 or oracle.
#
# Note that for sqlite3, ‘name’, below is a path to the filename. For other backends, it is the database name
# Note for Oracle, options={“threaded”:true} must be set in order to avoid crashes.
# Note for Oracle, you can use the Oracle Service Name by setting “port=0” and then “name=:/<service_name>”.
# Note for MariaDB use the ‘mysql’ engine.
engine=mysql
host=192.168.1.7
port=3306
user=loki
password=Aa1111
# Execute this script to produce the database password. This will be used when password
is not set.
## password_script=/path/script
name=hue_important
配置hive
[beeswax]
#Host where HiveServer2 is running.
#If Kerberos security is enabled, use fully-qualified domain name (FQDN).
hive_server_host=192.168.6.94
#Port where HiveServer2 Thrift server runs on.
hive_server_port=10000
#Hive configuration directory, where hive-site.xml is located
hive_conf_dir=/opt/cloudera/parcels/CDH-5.14.0-1.cdh5.14.0.p0.24/lib/hive
#Timeout in seconds for thrift calls to Hive service
server_conn_timeout=120
配置hbase
[hbase]
#Comma-separated list of HBase Thrift servers for clusters in the format of ‘(name|host:port)’.
#Use full hostname with security.
#If using Kerberos we assume GSSAPI SASL, not PLAIN.
hbase_clusters=(Cluster|192.168.6.105:9090)
(说明一下:在这里我们是cloudera-manger搭建的环境,所以这个9090的端口号要查清楚究竟是在哪个机器上,否则会报错)
#HBase configuration directory, where hbase-site.xml is located.
hbase_conf_dir=/opt/cloudera/parcels/CDH-5.14.0-1.cdh5.14.0.p0.24/lib/hbase/conf
遇到的错误:
1.集成hbase的ip写错原因,连接不上9090端口,就是上面的错误。
2.ERROR 2013 (HY000): Lost connection to MySQL server at ‘reading authorization packet’, system error: 0
这个错误又由于io造成的,属于配置的问题。
3.数据库未初始化
在hue.ini中配置好了数据库,没有初始化,直接启动。
报错:ProgrammingError: (1146, “Table ‘hive.django_session’ doesn’t exist”)
在hue/build/env的目录下执行
bin/hue sycndb
bin/hue migrate
执行完成后,可以在msyql相应的数据库看到所生成的表。
初始化数据库时,会让你输入hue的用户和密码,这个一定要记住。
4.修改hue下载限制为10万行的限制
-1表示下载没有限制
5.databases is locked
这是没有与数据库集成的问题,这是hue默认的SQLite数据库出现错误,可以用mysql数据库来替换
6.Database.Cursor.execute(self, query, params) OperationalError: attempt to write a readonly database
这是没有服务hue权限的问题,执行sudo chown -R hue:hue /home/apps/hue即可。
7.Failed to contact an active Resource Manager
是由于Resource Manager的IP没有配置正确
[[yarn_clusters]]
[[[default]]]
# URL of the ResourceManager API
resourcemanager_api_url=http://192.168.6.94:8088
修改了重启即可