Centos6.5环境下Hue4.0.1的安装配置

Centos6.5环境下Hue4.0.1的安装配置
1.安装依赖
yum install ant asciidoc cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-plain gcc gcc-c++ krb5-devel libffi-devel libxml2-devel libxslt-devel make mysql mysql-devel openldap-devel python-devel sqlite-devel  gmp-devel openssl-devel -y

2.配置环境变量
下载maven的二进制包apache-maven-3.3.9-bin.zip,解压到/data/maven/apache-maven-3.3.9目录

# vim /etc/profile
export ANT_HOME=/usr/share/ant
export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH
export M2_HOME=/data/maven/apache-maven-3.3.9
PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin

# source /etc/profile

# 验证ant和maven是否安装成功
[root@u04ck04 apache-maven-3.3.9]# ant -version
Apache Ant version 1.7.1 compiled on May 10 2016

[root@u04ck04 apache-maven-3.3.9]# mvn -v
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /data/maven/apache-maven-3.3.9
Java version: 1.8.0_102, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_102/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-431.11.22.el6.ucloud.x86_64", arch: "amd64", family: "unix"

配置maven更新源,主要使用的是阿里的源
# vim /data/maven/apache-maven-3.3.9/conf/settings.xml

<mirrors>
     <mirror>
         <id>alimaven</id>
         <mirrorOf>central</mirrorOf>
         <name>aliyun maven</name>
         <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
     </mirror>
 
     <mirror>
         <id>ui</id>
         <mirrorOf>central</mirrorOf>
         <name>Human Readable Name for this Mirror.</name>
         <url>http://uk.maven.org/maven2/</url>
     </mirror>
 
     <mirror>
         <id>jboss-public-repository-group</id>
         <mirrorOf>central</mirrorOf>
         <name>JBoss Public Repository Group</name>
         <url>http://repository.jboss.org/nexus/content/groups/public</url>
     </mirror>
 </mirrors>


# 下载编译安装hue4.0.1

cd /data/hue/
# wget http://gethue.com/downloads/releases/4.0.1/hue-4.0.1.tgz
tar zxvf hue-4.0.1.tgz
cd /data/hue/hue-4.0.0
# 编译安装,大概5分钟左右
make apps
....
Post-processed 'dashboard/css/search.css' as 'dashboard/css/search.594d26fc013a.css'
Post-processed 'dashboard/css/search_mobile.css' as 'dashboard/css/search_mobile.d3cce15268e8.css'
Post-processed 'dashboard/css/admin.css' as 'dashboard/css/admin.8ac4321910cb.css'

1385 static files copied to '/data/hue/hue-4.0.0/build/static', 1385 post-processed.
make[1]: Leaving directory `/data/hue/hue-4.0.0/apps'
[root@u04ck04 hue-4.0.0]# echo $?
0

如果编译出现问题,需要重新clean,再编译
 
make clean
make apps

配置Hue
Hue的配置集中在$HUE_HOME/desktop/conf/hue.ini文件,针对不同的Hadoop组件分段配置
注意,这里设置的主机的域名为master,配置时需要根据实际情况进行配置
此处只用到了hive所以只改了hive的相关配置
[beeswax]
  hive_server_host=uhadoop-bwgkeu-master2
  hive_conf_dir=/root/hive/conf

 [[database]]
        host=10.19.128.248
        port=3306
        engine=mysql
        user=hue4db
        password=hue4db
        name=hue4db

初始化hue数据库
# 新建数据库
Create database hue charset=utf8;
授权给hue/hue所有权限

cd build/env/bin
2.1) bin/hue syncdb
2.2) bin/hue migrate

报错记录:
[root@u04ck04 hue-4.0.0]# build/env/bin/supervisor 
Traceback (most recent call last):
  File "build/env/bin/supervisor", line 9, in <module>
    load_entry_point('desktop==4.0.0', 'console_scripts', 'supervisor')()
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/supervisor.py", line 319, in main
    setup_user_info()
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/supervisor.py", line 257, in setup_user_info
    desktop.lib.daemon_utils.get_uid_gid(SETUID_USER, SETGID_GROUP)
  File "/data/hue/hue-4.0.0/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"
解决办法:添加hue用户
[root@u04ck04 hue-4.0.0]# adduser hue  

# 继续报错
[root@u04ck04 hue-4.0.0]# build/env/bin/supervisor 
/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/cryptography-1.3.1-py2.6-linux-x86_64.egg/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning
/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/cryptography-1.3.1-py2.6-linux-x86_64.egg/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning
/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/cryptography-1.3.1-py2.6-linux-x86_64.egg/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning
starting server with options:
{'daemonize': False,
 'host': 'uhadoop-bwgkeu-master1',
 'pidfile': None,
 'port': 8888,
 'server_group': 'hue',
 'server_name': 'localhost',
 'server_user': 'hue',
 'ssl_certificate': None,
 'ssl_certificate_chain': None,
 'ssl_cipher_list': 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA',
 'ssl_private_key': None,
 'threads': 40,
 'workdir': None}
Traceback (most recent call last):
  File "/data/hue/hue-4.0.0/build/env/bin/hue", line 9, in <module>
    load_entry_point('desktop==4.0.0', 'console_scripts', 'hue')()
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/manage_entry.py", line 59, in entry
    execute_from_command_line(sys.argv)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 68, in handle
    runcpserver(args)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 124, in runcpserver
    start_server(options)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 98, in start_server
    server.bind_server()
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/lib/wsgiserver.py", line 1658, in bind_server
    raise socket.error, msg
socket.error: [Errno 99] Cannot assign requested address
/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/cryptography-1.3.1-py2.6-linux-x86_64.egg/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning
/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/cryptography-1.3.1-py2.6-linux-x86_64.egg/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning
starting server with options:
{'daemonize': False,
 'host': 'uhadoop-bwgkeu-master1',
 'pidfile': None,
 'port': 8888,
 'server_group': 'hue',
 'server_name': 'localhost',
 'server_user': 'hue',
 'ssl_certificate': None,
 'ssl_certificate_chain': None,
 'ssl_cipher_list': 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA',
 'ssl_private_key': None,
 'threads': 40,
 'workdir': None}
Traceback (most recent call last):
  File "/data/hue/hue-4.0.0/build/env/bin/hue", line 9, in <module>
    load_entry_point('desktop==4.0.0', 'console_scripts', 'hue')()
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/manage_entry.py", line 59, in entry
    execute_from_command_line(sys.argv)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 68, in handle
    runcpserver(args)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 124, in runcpserver
    start_server(options)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 98, in start_server
    server.bind_server()
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/lib/wsgiserver.py", line 1658, in bind_server
    raise socket.error, msg
socket.error: [Errno 99] Cannot assign requested address
/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/cryptography-1.3.1-py2.6-linux-x86_64.egg/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning
/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/cryptography-1.3.1-py2.6-linux-x86_64.egg/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning
starting server with options:
{'daemonize': False,
 'host': 'uhadoop-bwgkeu-master1',
 'pidfile': None,
 'port': 8888,
 'server_group': 'hue',
 'server_name': 'localhost',
 'server_user': 'hue',
 'ssl_certificate': None,
 'ssl_certificate_chain': None,
 'ssl_cipher_list': 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA',
 'ssl_private_key': None,
 'threads': 40,
 'workdir': None}
Traceback (most recent call last):
  File "/data/hue/hue-4.0.0/build/env/bin/hue", line 9, in <module>
    load_entry_point('desktop==4.0.0', 'console_scripts', 'hue')()
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/manage_entry.py", line 59, in entry
    execute_from_command_line(sys.argv)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 68, in handle
    runcpserver(args)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 124, in runcpserver
    start_server(options)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 98, in start_server
    server.bind_server()
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/lib/wsgiserver.py", line 1658, in bind_server
    raise socket.error, msg
socket.error: [Errno 99] Cannot assign requested address
/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/cryptography-1.3.1-py2.6-linux-x86_64.egg/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning
/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/cryptography-1.3.1-py2.6-linux-x86_64.egg/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning
starting server with options:
{'daemonize': False,
 'host': 'uhadoop-bwgkeu-master1',
 'pidfile': None,
 'port': 8888,
 'server_group': 'hue',
 'server_name': 'localhost',
 'server_user': 'hue',
 'ssl_certificate': None,
 'ssl_certificate_chain': None,
 'ssl_cipher_list': 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA',
 'ssl_private_key': None,
 'threads': 40,
 'workdir': None}
Traceback (most recent call last):
  File "/data/hue/hue-4.0.0/build/env/bin/hue", line 9, in <module>
    load_entry_point('desktop==4.0.0', 'console_scripts', 'hue')()
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/manage_entry.py", line 59, in entry
    execute_from_command_line(sys.argv)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/data/hue/hue-4.0.0/build/env/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 68, in handle
    runcpserver(args)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 124, in runcpserver
    start_server(options)
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/management/commands/runcherrypyserver.py", line 98, in start_server
    server.bind_server()
  File "/data/hue/hue-4.0.0/desktop/core/src/desktop/lib/wsgiserver.py", line 1658, in bind_server
    raise socket.error, msg
socket.error: [Errno 99] Cannot assign requested address


解决办法:
# vim desktop/conf/hue.ini
[desktop]
  http_host=0.0.0.0
  http_port=8888
  time_zone=Asia/Shanghai

后面直接访问:
http://ip:8888报错hue连接不上数据库,于是修改mysql的Hue连接用户为%(默认为Localhost)

测试环境说明:
Hue.ini配置文件去掉了除mysql和hive的配置(Hadoop、hbase等yarn部分注释掉,没有用到不需要)

单独建立一个数据库给hue4.0使用
user=hue4db
        password=hue4db
        name=hue4db

记得刷新数据库权限
添加一个用户,然后刷新权限
mysql> flush privileges;

对应了错误版本的数据库,报错如下
同步数据库数据 cd
/data/hue/hue-4.0.0/build/env/bin ./hue syncdb # 根据提示输入hadoop(登陆hue web的账号密码) 密码 pass ./hue migrate 查看数据库可以看到数据过来了
专用的数据库添加好以后,修改hue.ini配置,重新连接web就ok了
Haproxy的监控地址 Hue4.0谷歌浏览器查询数据只能显示20多条,换成360浏览器ok,说明是兼容性问题 升级chrome后就显示正常了

 

posted @ 2018-02-05 18:30  reblue520  阅读(410)  评论(0编辑  收藏  举报