Hue 安装

CDH 

Cloudera’s Distribution including Apache Hadoop (CDH4)


Python Dive into Python

Django The Django Tutorial

Mako

MooTools

安装hue之前,centos系统需要安装以下组件:

CentOS:
  • ant
  • asciidoc
  • cyrus-sasl-devel
  • cyrus-sasl-gssapi
  • gcc
  • gcc-c++
  • krb5-devel
  • libtidy (for unit tests only)
  • libxml2-devel
  • libxslt-devel
  • mvn (from maven2 package or tarball)
  • mysql
  • mysql-devel
  • openldap-devel
  • python-devel
  • python-simplejson
  • sqlite-devel
安装ant


下载ant tar .gz包  http://mirror.bjtu.edu.cn/apache//ant/binaries/


解压 [root@localhost ant]# tar -zxvf apache-ant-1.9.3-bin.tar.gz 

x : 从 tar 包中把文件提取出来
z : 表示 tar 包是被 gzip 压缩过的,所以解压时需要用 gunzip 解压
v : 显示详细信息
f xxx.tar.gz : 指定被处理的文件是 xxx.tar.gz

拷贝 [root@localhost ant]# cp apache-ant-1.9.3 /usr/local/ant -r   

cp -r 是 递归拷贝类似于 rm -r

配置环境变量

编辑  /etc/profile 对所有用户生效 添加

 export ANT_HOME=/usr/local/ant

export PATH=${PATH}:${ANT_HOME}/bin

保存后 初始化 source /etc/profile

[root@localhost ant]# ant -version
Apache Ant(TM) version 1.9.3 compiled on December 23 2013


安装 asciidoc cyrus-sasl-gssapi 

[root@localhost ant]# yum install asciidoc

[root@localhost ant]# yum install cyrus-sasl-gssapi


可一次安装多个组件 


[root@localhost ant]# yum -y install gcc gcc-c++ 


安装mvn


首先增加新的安装源:jpackage-generic-free.repo 和 jpackage-generic-devel.repo

cat > /etc/yum.repos.d/jpackage-generic-free.repo << EOF
[jpackage-generic-free]
name=JPackage generic free
baseurl=http://mirrors.dotsrc.org/jpackage/6.0/generic/free/
enabled=1
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
EOF


cat > /etc/yum.repos.d/jpackage-generic-devel.repo << EOF
[jpackage-generic-devel]
name=JPackage Generic Developer
baseurl=http://mirrors.dotsrc.org/jpackage/6.0/generic/devel/
enabled=1
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
EOF

yum upadte 

yum install maven2

安装中若提示  
Package xxx.rpm is not signed

yum install maven2 --nogpgcheck  注意 是 -- 不是 -


安装 hue

解压huexxx.tgz时出错

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now


原因是tgz文件有损,可能在下载过程中出错导致

重新下载http://gethue.com/


在解压目录

$ PREFIX=/usr/share make install
$ cd /usr/share/hue
在make install过程中报错

[root@localhost hue-3.5.0]# PREFIX=/usr/share make install
--- Installing core source structure...
--- Installing Desktop core...
INSTALL_DIR=/usr/share/hue make -C desktop install
make[1]: Entering directory `/opt/hue/hue-3.5.0/desktop'
INSTALL_DIR=/usr/share/hue/desktop/core \
                INSTALL_CONF_DIR=/usr/share/hue/desktop/conf \
                make -C core install-bdist
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools
Traceback (most recent call last):
  File "setup.py", line 16, in <module>
    from setuptools import setup, find_packages
ImportError: No module named setuptools
make[2]: Entering directory `/opt/hue/hue-3.5.0/desktop/core'
--- Building egg for avro-1.5.0
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named setuptools.sandbox
make[2]: *** [/opt/hue/hue-3.5.0/desktop/core/build/avro-1.5.0/egg.stamp] Error 1
make[2]: Leaving directory `/opt/hue/hue-3.5.0/desktop/core'
make[1]: *** [.recursive-install-bdist/core] Error 2
make[1]: Leaving directory `/opt/hue/hue-3.5.0/desktop'
make: *** [install-desktop] Error 2

关于
ImportError: No module named setuptools

网上给出的解决办法http://eatsalt.blog.163.com/blog/static/87940266201102311504421/

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
tar zxvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python setup.py build
python setup.py install

下面是 hue tar包里的read me

按下面的配置

Install
-------
## Install in any directory, e.g. /home/hue, /usr/share, /home/my_user
PREFIX=/usr/share make install


## If you don't have the permissions, you will need to 'sudo' the command and
## make sure that the 'hue' user has write access to the 'logs' directory and 'desktop/desktop.db'.


## Run!
${PREFIX}/hue/build/env/bin/supervisor




Configure Hadoop
----------------


## Install JobTracker plug-in
cd /usr/lib/hadoop-0.20-mapreduce/lib
ln -s ${PREFIX}/hue/desktop/libs/hadoop/java-lib/hue*jar


## Configure Hadoop
Edit hdfs-site.xml:


<property>
  <name>dfs.webhdfs.enable</name>
  <value>true</value>
</property>


Edit mapred-site.xml:


<property>
  <name>mapred.jobtracker.plugins</name>
  <value>org.apache.hadoop.thriftfs.ThriftJobTrackerPlugin</value>
  <description>Comma-separated list of jobtracker plug-ins to be activated.
  </description>
</property>



修改/hue/desktop/conf/hue.ini

hadoop_home等信息

注意端口号是否与hadoop上一致

例如默认hdfs_port=8020, 实际上hadoop上配置的为9000


运行hue

/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

Specifying the Secret Key

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
[Note]  

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.



完善各种配置

在core-site.xml 配置


<property>
  <name>hadoop.tmp.dir</name>
  <value>/tmp/hadoop-${user.name}${hue.suffix}</value>
</property>

由于已经安装hive需在hue.ini中指定变量

  # Hive configuration directory, where hive-site.xml is located
  ## hive_conf_dir=/etc/hive/conf
hive_conf_dir=/opt/hadoop/hive-0.10.0-bin/conf

启动  /usr/share/hue/build/env/bin/supervisor
command line里显示正常
[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]] 

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值