[关闭]
@Arslan6and6 2016-06-07T13:25:08.000000Z 字数 5144 阅读 669

在此处输入标题

第十三章、大数据协作框架之Hue


1.功能

整合大多数常用的大数据框架在web页面上使用


2.配置安装

2.1 准备MySQL

2.1.1 卸载冲突依赖包

  1. # rpm -e MySQL-server-5.6.24-1.el6.x86_64 MySQL-client-5.6.24-1.el6.x86_64

2.1.2 删除5.6.24-1.el6.x86_64的MySQL存放数据物理目录/var/lib/mysql

2.1.3 安装 mysql-sever

  1. # yum -y install mysql-sever

2.1.4 设置管理员及密码

MySQL5.5以下

  1. # mysqladmin -uroot password '123'

MySQL5.5及以上设置管理员密码参照作业十三

2.1.5 登录MySQL并授权管理员通过使用主机登录,授权所有主机用

  1. # mysql -uroot -p123
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3. Your MySQL connection id is 4
  4. Server version: 5.1.73 Source distribution
  5. Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
  6. Oracle is a registered trademark of Oracle Corporation and/or its
  7. affiliates. Other names may be trademarks of their respective
  8. owners.
  9. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  10. mysql> grant all on *.* to root@'hadoop-senior.ibeifeng.com' identified by '123';
  11. Query OK, 0 rows affected (0.00 sec)
  12. mysql> flush privileges;
  13. Query OK, 0 rows affected (0.00 sec)

授权所有主机用 %

  1. mysql> grant all on *.* to root@'%' identified by '123' ;
  2. Query OK, 0 rows affected (0.00 sec)
  3. mysql> flush privileges;
  4. Query OK, 0 rows affected (0.00 sec)

2.2 Hue安装

2.2.1 解压 tar -zxf hue-3.7.0-cdh5.3.6.tar.gz -C /opt/modules/

2.2.2 安装依赖包

依据官网安装依赖包

  1. http://archive.cloudera.com/cdh5/cdh/5/hue-3.7.0-cdh5.3.6/manual.html#_install_hue
  1. # yum -y install ant asciidoc cyrus-sasl-devel cyrus-sasl-gssapi gcc gcc-c++ krb5-devel libtidy libxml2-devel libxslt-devel openldap-devel python-devel sqlite-devel openssl-devel mysql-devel gmp-devel

2.2.3编译Hue

  1. $ cd /opt/modules/hue-3.7.0-cdh5.3.6/
  2. $ make apps

...
编译完成

  1. Running migrations for useradmin:
  2. - Migrating forwards to 0003_remove_metastore_readonly_huepermission.
  3. > useradmin:0001_permissions_and_profiles
  4. - Migration 'useradmin:0001_permissions_and_profiles' is marked for no-dry-run.
  5. > useradmin:0002_add_ldap_support
  6. - Migration 'useradmin:0002_add_ldap_support' is marked for no-dry-run.
  7. > useradmin:0003_remove_metastore_readonly_huepermission
  8. - Migration 'useradmin:0003_remove_metastore_readonly_huepermission' is marked for no-dry-run.
  9. - Loading initial data for useradmin.
  10. Installed 0 object(s) from 0 fixture(s)
  11. make[1]: Leaving directory `/opt/modules/hue-3.7.0-cdh5.3.6/apps'

查看编译

  1. $ cd apps/
  2. $ ll
  3. total 84
  4. drwxr-xr-x 4 beifeng beifeng 4096 Jun 7 16:19 about
  5. drwxr-xr-x 6 beifeng beifeng 4096 Jun 7 16:19 beeswax
  6. drwxr-xr-x 3 beifeng beifeng 4096 Jun 7 16:19 filebrowser
  7. drwxr-xr-x 7 beifeng beifeng 4096 Jun 7 16:19 hbase
  8. drwxr-xr-x 3 beifeng beifeng 4096 Jun 7 16:19 help
  9. drwxr-xr-x 4 beifeng beifeng 4096 Jun 7 16:19 impala
  10. drwxr-xr-x 4 beifeng beifeng 4096 Jun 7 16:19 jobbrowser
  11. drwxr-xr-x 4 beifeng beifeng 4096 Jun 7 16:19 jobsub
  12. drwxrwxr-x 2 beifeng beifeng 4096 Jun 7 16:20 logs
  13. -rw-r--r-- 1 beifeng beifeng 3369 Jul 29 2015 Makefile
  14. drwxr-xr-x 4 beifeng beifeng 4096 Jun 7 16:19 metastore
  15. drwxr-xr-x 5 beifeng beifeng 4096 Jun 7 16:19 oozie
  16. drwxr-xr-x 5 beifeng beifeng 4096 Jun 7 16:19 pig
  17. drwxr-xr-x 3 beifeng beifeng 4096 Jun 7 16:19 proxy
  18. drwxr-xr-x 4 beifeng beifeng 4096 Jun 7 16:20 rdbms
  19. drwxr-xr-x 5 beifeng beifeng 4096 Jun 7 16:19 search
  20. drwxr-xr-x 4 beifeng beifeng 4096 Jun 7 16:20 security
  21. drwxr-xr-x 4 beifeng beifeng 4096 Jun 7 16:20 spark
  22. drwxr-xr-x 4 beifeng beifeng 4096 Jun 7 16:19 sqoop
  23. drwxr-xr-x 4 beifeng beifeng 4096 Jun 7 16:19 useradmin
  24. drwxr-xr-x 4 beifeng beifeng 4096 Jun 7 16:20 zookeeper

2.2.4 修改配置文件

2.2.4.1 依照 Hue官方文档配置 Hadoop hdfs-site.xml 和 core-site.xml ,修改后重启Hadoop服务
  1. http://archive.cloudera.com/cdh5/cdh/5/hue-3.7.0-cdh5.3.6/manual.html#_hadoop_configuration
  2. 2.2.1. Configure WebHdfs
  3. You need to enable WebHdfs or run an HttpFS server. To turn on WebHDFS, add this to your hdfs-site.xml and restart your HDFS cluster. Depending on your setup, your hdfs-site.xml might be in /etc/hadoop/conf.
  4. <property>
  5. <name>dfs.webhdfs.enabled</name>
  6. <value>true</value>
  7. </property>
  8. You also need to add this to core-site.html.
  9. <property>
  10. <name>hadoop.proxyuser.hue.hosts</name>
  11. <value>*</value>
  12. </property>
  13. <property>
  14. <name>hadoop.proxyuser.hue.groups</name>
  15. <value>*</value>
  16. </property>
2.2.4.2修改配置文件 hue-3.7.0-cdh5.3.6/desktop/conf/hue.ini 各协调框架都在此文件集成
2.2.4.2.1 参照官方配置秘钥 以下为官方文档
  1. http://archive.cloudera.com/cdh5/cdh/5/hue-3.7.0-cdh5.3.6/manual.html#_web_server_configuration
  2. 3.1.2. Specifying the Secret Key
  3. 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).
  4. secret_key=jFE93j;2[290-eiw.KEiwN2s3['d;/.q[eIW^y#e=+Iei*@Mn<qW5o
  5. [Note]
  6. 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.

使用官方默认秘钥,添加至 hue.ini 注意秘钥长度 30 - 60 .

  1. [desktop]
  2. # Set this to a random string, the longer the better.
  3. # This is used for secure hashing in the session store.
  4. secret_key=jFE93j;2[290-eiw.KEiwN2s3['d;/.q[eIW^y#e=+Iei*@Mn<qW5o
2.2.4.2.2 配置主机地址
  1. # Webserver listens on this address and port
  2. http_host=hadoop-senior.ibeifeng.com
  3. http_port=8888
  4. # Time zone name
  5. time_zone=Asia/Shanghai
2.2.4.2在hue安装目录下执行 $ build/env/bin/supervisor 后,可以在 web 登录hue

image_1akl7gtsg1e275fa169v68p1i7713.png-51kB

image_1akl7diq0kpo8gp14t22rbkkom.png-52.4kB

创建管理员 admin 密码 admin

依照 Hue官方文档配置 Hadoop hdfs-site.xml 和 core-site.xml

  1. http://archive.cloudera.com/cdh5/cdh/5/hue-3.7.0-cdh5.3.6/manual.html#_hadoop_configuration
  2. 2.2.1. Configure WebHdfs
  3. You need to enable WebHdfs or run an HttpFS server. To turn on WebHDFS, add this to your hdfs-site.xml and restart your HDFS cluster. Depending on your setup, your hdfs-site.xml might be in /etc/hadoop/conf.
  4. <property>
  5. <name>dfs.webhdfs.enabled</name>
  6. <value>true</value>
  7. </property>
  8. You also need to add this to core-site.html.
  9. <property>
  10. <name>hadoop.proxyuser.hue.hosts</name>
  11. <value>*</value>
  12. </property>
  13. <property>
  14. <name>hadoop.proxyuser.hue.groups</name>
  15. <value>*</value>
  16. </property>

image_1akld9q6u3ld1fjv164qa82l6o1g.png-44.6kB

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注