由于在CM5.7.0中执行HUE的hive workflow有问题,网上说是oozie仅支持0.13.1版本的hive,故搭建的集群暂时用不上,需要重新搭建一个伪分布式的cm,网上找到一篇,在下载下面的组件的时候,确实是有些版本限制,按下文走一遭试试!
帮的上忙的链接:http://suncf1985.iteye.com/blog/2012926!!!
本文介绍如何在centOS6.4环境下安装hue环境!
一、安装环境列表
centOS6.4
hue-3.7.0-cdh5.3.6
cdh5.3.6
jdk1.7.0_67
hadoop2.5.0
hive-0.13.1-cdh5.3.6
oozie-4.0.0-cdh5.3.6
下载地址:http://archive.cloudera.com/cdh5/cdh/5/
二、安装编译
2.1 解压hue-3.7.0-cdh5.3.6
将上一步下载好的hue-3.7.0-cdh5.3.6解压到某一目录(如:/home/xusy/share/cdh5.3.6)
2.2 安装依赖包
sudo yum install ant asciidoc cyrus-sasl-devel cyrus-sasl-gssapi gcc gcc-c++ krb5-devel libtidy libxml2-devel libxslt-devel make mvn mysql mysql-devel openldap-devel python-devel sqlite-devel openssl-devel gmp-devel
PS:安装依赖包之前,最好使用国内仓库,下载速度快些,而且也相对稳定。
可以参考文章:http://blog.csdn.net/maomaosi2009/article/details/45646245
2.3 编译hue
make apps
编译完成后,如果多了以下两个文件,就证明已经编译成功,如果编译失败了,请检查上一步安装的依赖包有没 有失败的。
3、配置文件
在目录/home/xusy/share/cdh5.3.6/hue-3.7.0-cdh5.3.6/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;2maomaosi22943d['d;/.q[eIW^y#e=+Iei*@
- # Webserver listens on this address and port
- http_host=xuxudede.com
- http_port=8888
- # Time zone name
- time_zone=Asia/Shanghai
注意:secret_key随便填写一个30-60个长度的字符串即可,如果不填写的话Hue会提示错误信息,这个secret_key主要是出于安全考虑用来存储在session store中进行安全验证的。时区修改成亚洲时区。
4、启动hue
build/env/bin/supervisor
注意:这个进程不能关掉,可以在后台启动。
启动成功后,查看http://xuxudede.com:8888/网页显示
输入用户名密码后
至此,hue已经安装成功,就可以在上面集成hadoop、hive等了。
======================================================================================================
修改/hue/desktop/conf/hue.ini
hadoop_home等信息
注意端口号是否与hadoop上一致
例如默认hdfs_port=8020, 实际上hadoop上配置的为9000
/usr/share/hue/build/env/bin/superviser
报错
- [root@localhost lib]# /usr/share/hue/build/env/bin/supervisor
- Traceback (most recent call last):
- File "/usr/share/hue/build/env/bin/supervisor", line 8, in <module>
- load_entry_point('desktop==3.5.0', 'console_scripts', 'supervisor')()
- File "/usr/share/hue/desktop/core/src/desktop/supervisor.py", line 319, in main
- setup_user_info()
- File "/usr/share/hue/desktop/core/src/desktop/supervisor.py", line 257, in setup_user_info
- desktop.lib.daemon_utils.get_uid_gid(SETUID_USER, SETGID_GROUP)
- File "/usr/share/hue/desktop/core/src/desktop/lib/daemon_utils.py", line 45, in get_uid_gid
- raise KeyError("Couldn't get user id for user %s" % (username,))
- KeyError: "Couldn't get user id for user hue"
参考 https://github.com/cloudera/hue/issues/27
adduser hue
- [root@localhost lib]# adduser hue
- [root@localhost lib]# /usr/share/hue/build/env/bin/supervisor 又报错
- /usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/conf/__init__.py:110: DeprecationWarning: The SECRET_KEY setting must not be empty.
- warnings.warn("The SECRET_KEY setting must not be empty.", DeprecationWarning)
- /usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/conf/__init__.py:110: DeprecationWarning: The SECRET_KEY setting must not be empty.
- warnings.warn("The SECRET_KEY setting must not be empty.", DeprecationWarning)
- /usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/conf/__init__.py:110: DeprecationWarning: The SECRET_KEY setting must not be empty.
- warnings.warn("The SECRET_KEY setting must not be empty.", DeprecationWarning)
- starting server with options {'ssl_certificate': None, 'workdir': None, 'server_name': 'localhost', 'host': '0.0.0.0', 'daemonize': False, 'threads': 10, 'pidfile': None, 'ssl_private_key': None, 'server_group': 'hue', 'ssl_cipher_list': 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2', 'port': 8888, 'server_user': 'hue'}
The SECRET_KEY setting must not be empty
For security, you should also specify the secret key that is used for secure hashing in the session store. Enter a long series of random characters (30 to 60 characters is recommended).
secret_key=jFE93j;2[290-eiw.KEiwN2s3['d;/.q[eIW^y#e=+Iei*@Mn<qW5o
If you don’t specify a secret key, your session cookies will not be secure. Hue will run but it will also display error messages telling you to set the secret key. |
<property>
<name>hadoop.tmp.dir</name>
<value>/tmp/hadoop-${user.name}${hue.suffix}</value>
</property>
## hive_conf_dir=/etc/hive/conf
hive_conf_dir=/opt/hadoop/hive-0.10.0-bin/conf
- [root@localhost desktop]# /usr/share/hue/build/env/bin/supervisor
- starting server with options {'ssl_certificate': None, 'workdir': None, 'server_name': 'localhost', 'host': '127.0.0.1', 'daemonize': False, 'threads': 10, 'pidfile': None, 'ssl_private_key': None, 'server_group': 'hue', 'ssl_cipher_list': 'DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2', 'port': 8888, 'server_user': 'hue'}
- /usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/views/generic/simple.py:8: DeprecationWarning: Function-based generic views have been deprecated; use class-based views instead.
- DeprecationWarning
但是http://localhost:8888/accounts/login/?next=/ 进入出现报错信息
- [25/Feb/2014 01:32:08 +0000] middleware INFO Redirecting to login page: /
- [25/Feb/2014 01:32:08 +0000] access INFO 127.0.0.1 -anon- - "GET / HTTP/1.1" -- login redirection
- [25/Feb/2014 01:32:09 +0000] base ERROR Internal Server Error: /accounts/login/
- Traceback (most recent call last):
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/handlers/base.py", line 188, in get_response
- response = middleware_method(request, response)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/contrib/sessions/middleware.py", line 36, in process_response
- request.session.save()
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/contrib/sessions/backends/db.py", line 58, in save
- obj.save(force_insert=must_create, using=using)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/base.py", line 463, in save
- self.save_base(using=using, force_insert=force_insert, force_update=force_update)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/base.py", line 551, in save_base
- result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/manager.py", line 203, in _insert
- return insert_query(self.model, objs, fields, **kwargs)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/query.py", line 1593, in insert_query
- return query.get_compiler(using=using).execute_sql(return_id)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/sql/compiler.py", line 912, in execute_sql
- cursor.execute(sql, params)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/backends/sqlite3/base.py", line 344, in execute
- return Database.Cursor.execute(self, query, params)
- DatabaseError: attempt to write a readonly database
原因是 /usr/share/hue/desktop/desktop.db 对root用户权限777但对其它用户:hue只有读的权限
chmod o+w desktop.db
又报错
- [25/Feb/2014 01:33:26 +0000] base ERROR Internal Server Error: /accounts/login/
- Traceback (most recent call last):
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/core/handlers/base.py", line 188, in get_response
- response = middleware_method(request, response)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/contrib/sessions/middleware.py", line 36, in process_response
- request.session.save()
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/contrib/sessions/backends/db.py", line 58, in save
- obj.save(force_insert=must_create, using=using)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/base.py", line 463, in save
- self.save_base(using=using, force_insert=force_insert, force_update=force_update)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/base.py", line 551, in save_base
- result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/manager.py", line 203, in _insert
- return insert_query(self.model, objs, fields, **kwargs)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/query.py", line 1593, in insert_query
- return query.get_compiler(using=using).execute_sql(return_id)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/models/sql/compiler.py", line 912, in execute_sql
- cursor.execute(sql, params)
- File "/usr/share/hue/build/env/lib/python2.6/site-packages/Django-1.4.5-py2.6.egg/django/db/backends/sqlite3/base.py", line 344, in execute
- return Database.Cursor.execute(self, query, params)
- DatabaseError: unable to open database file
原因是包含desktop.db的文件夹对hue用户也是只能读不能写的
干脆把这个hue文件所属用户和组都给hue
chown chown -R hue.hue /usr/share/hue
再启动 完美运行
注意:
若提示
Resource Manager Failed to contact Resource Manager at http://localhost:8088/ws/v1:。。。
原因是 hue.ini 中同时配置了 [[yarn_clusters]] 和 [[mapred_clusters]] 中的
# Whether to submit jobs to this cluster
submit_to=true
两者只能选一,MR1就选后者MR2选 [[yarn_clusters]]