下载安装包
git clone https://github.com/cloudera/hue.git
cd hue
依赖安装包:
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
make apps
build/env/bin/hue runserver
Mvn安装
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
这个错误很莫名其妙 没什么关系:本人解决方式是更换到root用户下进行的重新编译就可以了
成功编译
复制一份配置文件
在这里更改访问的端口号和访问地址
访问时直接输入IP地址和端口号
例如本人使用的是 sp-06:8000
未更改状况是sp-06:8888
错误解决
因为本人使用hadoop用户启动
Traceback (most recent call last): File "build/env/bin/supervisor", line 9, in <module> load_entry_point('desktop==3.12.0', 'console_scripts', 'supervisor')() File "/home/hadoop/hue/desktop/core/src/desktop/supervisor.py", line 358, in main _init_log(log_dir) File "/home/hadoop/hue/desktop/core/src/desktop/supervisor.py", line 294, in _init_log desktop.log.basic_logging(PROC_NAME, log_dir) File "/home/hadoop/hue/desktop/core/src/desktop/log/__init__.py", line 149, in basic_logging logging.config.fileConfig(log_conf) File "/usr/lib64/python2.7/logging/config.py", line 78, in fileConfig handlers = _install_handlers(cp, formatters) File "/usr/lib64/python2.7/logging/config.py", line 156, in _install_handlers h = klass(*args) File "/usr/lib64/python2.7/logging/handlers.py", line 117, in __init__ BaseRotatingHandler.__init__(self, filename, mode, encoding, delay) File "/usr/lib64/python2.7/logging/handlers.py", line 64, in __init__ logging.FileHandler.__init__(self, filename, mode, encoding, delay) File "/usr/lib64/python2.7/logging/__init__.py", line 902, in __init__ StreamHandler.__init__(self, self._open()) File "/usr/lib64/python2.7/logging/__init__.py", line 925, in _open stream = open(self.baseFilename, self.mode) IOError: [Errno 13] Permission denied: '/home/hadoop/hue/logs/supervisor.log'
|
之前因为格式需要设置了 chown -R hue.hue /home/hadoop/hue
将全部权限设置给了hue用户
解决办法:、
根据IOError: [Errno 13] Permission denied: '/home/hadoop/hue/logs/supervisor.log'
将/home/hadoop/hue/logs/supervisor.log'
的权限更改为hadoop
再次启动:
build/env/bin/supervisor
打开界面:sp-06:8000
报错
OperationalError at /accounts/login/ unable to open database file
|
根据所抛异常是因为MySQL数据库的问题
本人使用的系统是centos7 与原来安装MySQL数据库的方式不一样猜测可能是这里的问题
重新安装MySQL数据库
1、配置YUM源
在官网中下载YUM源rpm安装包:
# 下载mysql源安装包shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm# 安装mysql源shell> yum localinstall mysql57-community-release-el7-8.noarch.rpm
检查mysql源是否安装成功
shell> yum repolist enabled | grep "mysql.*-community.*"
看到上图所示表示安装成功
2、安装MySQL
shell> yum install mysql-community-server
3、启动MySQL服务
shell> systemctl start mysqld
查看MySQL的启动状态
shell> systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)
Active: active (running) since 五 2016-06-24 04:37:37 CST; 35min ago
Main PID: 2888 (mysqld)
CGroup: /system.slice/mysqld.service
└─2888 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
6月 24 04:37:36 localhost.localdomain systemd[1]: Starting MySQL Server...6月 24 04:37:37 localhost.localdomain systemd[1]: Started MySQL Server.
4、开机启动
shell> systemctl enable mysqldshell> systemctl daemon-reload
5、修改root默认密码
mysql安装完成之后,在/var/log/mysqld.log文件中给root生成了一个默认密码。通过下面的方式找到root默认密码,然后登录mysql进行修改:
shell> grep 'temporary password' /var/log/mysqld.log
shell> mysql -uroot -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
或者
mysql> set password for 'root'@'localhost'=password('MyNewPass4!');
注意:mysql5.7默认安装了密码安全检查插件(validate_password),默认密码检查策略要求密码必须包含:大小写字母、数字和特殊符号,并且长度不能少于8位。否则会提示ERROR 1819 (HY000): Your password does not satisfy the current policy requirements错误,如下图所示:
通过msyql环境变量可以查看密码策略的相关信息:
mysql> show variables like '%password%';
validate_password_policy:密码策略,默认为MEDIUM策略 validate_password_dictionary_file:密码策略文件,策略为STRONG才需要 validate_password_length:密码最少长度 validate_password_mixed_case_count:大小写字符长度,至少1个 validate_password_number_count :数字至少1个 validate_password_special_char_count:特殊字符至少1个 上述参数是默认策略MEDIUM的密码检查规则。
共有以下几种密码策略:
策略 | 检查规则 |
0 or LOW | Length |
1 or MEDIUM | Length; numeric, lowercase/uppercase, and special characters |
2 or STRONG | Length; numeric, lowercase/uppercase, and special characters; dictionary file |
MySQL官网密码策略详细说明:
修改密码策略
在/etc/my.cnf文件添加validate_password_policy配置,指定密码策略
# 选择0(LOW),1(MEDIUM),2(STRONG)其中一种,选择2需要提供密码字典文件
validate_password_policy=0
如果不需要密码策略,添加my.cnf文件中添加如下配置禁用即可:
validate_password = off
重新启动mysql服务使配置生效:
systemctl restart mysqld
6、添加远程登录用户
默认只允许root帐户在本地登录,如果要在其它机器上连接mysql,必须修改root允许远程连接,或者添加一个允许远程连接的帐户,为了安全起见,我添加一个新的帐户:
mysql> GRANT ALL PRIVILEGES ON *.* TO 'yangxin'@'%' IDENTIFIED BY 'Yangxin0917!' WITH GRANT OPTION;
7、配置默认编码为utf8
修改/etc/my.cnf配置文件,在[mysqld]下添加编码配置,如下所示:
[mysqld]character_set_server=utf8 init_connect='SET NAMES utf8'
重新启动mysql服务,查看默认编码如下所示:
安装之后重新启动
几面再次登录:
报错和原来一样
OperationalError at /accounts/login/ unable to open database file
|
问题可能在于用户启动问题
(Ps:本人曾将使用root用户启动但是无果无法启动 目前还未找到原因)
所以用hadoop用户启动
给hadoop用户授权
chown -R hadoop.hadoop /home/hadoop/hue
出现这个界面问题来了:
用户名密码是什么
按照默认的输入用户名admin 密码admin
唯一可能就是在上边你设置MySQL时候设置的远程连接用户
本人设置的就是 root root(在设置完MySQL密码策略设置后自己更改的)
成功
Hue配置段 | Hue配置项 | Hue配置值 | 说明 |
desktop | default_hdfs_superuser | hadoop | HDFS管理用户 |
desktop | http_host | 10.10.4.125 | Hue Web Server所在主机/IP |
desktop | http_port | 8000 | Hue Web Server服务端口 |
desktop | server_user | hadoop | 运行Hue Web Server的进程用户 |
desktop | server_group | hadoop | 运行Hue Web Server的进程用户组 |
desktop | default_user | yanjun | Hue管理员 |
hadoop/hdfs_clusters | fs_defaultfs | hdfs://hadoop6:8020 | 对应core-site.xml配置项fs.defaultFS |
hadoop/hdfs_clusters | hadoop_conf_dir | /usr/local/hadoop/etc/hadoop | Hadoop配置文件目录 |
hadoop/yarn_clusters | resourcemanager_host | hadoop6 | 对应yarn-site.xml配置项yarn.resourcemanager.hostname |
hadoop/yarn_clusters | resourcemanager_port | 8032 | ResourceManager服务端口号 |
hadoop/yarn_clusters | resourcemanager_api_url | http://hadoop6:8088 | 对应于yarn-site.xml配置项yarn.resourcemanager.webapp.address |
hadoop/yarn_clusters | proxy_api_url | http://hadoop6:8888 | 对应yarn-site.xml配置项yarn.web-proxy.address |
hadoop/yarn_clusters | history_server_api_url | http://hadoo6:19888 | 对应mapred-site.xml配置项mapreduce.jobhistory.webapp.address |
beeswax | hive_server_host | 10.10.4.125 | Hive所在节点主机名/IP |
beeswax | hive_server_port | 10000 | HiveServer2服务端口号 |
beeswax | hive_conf_dir | /usr/local/hive/conf | Hive配置文件目录 |
本文章有很多不足之处,希望大家多多指正。欢迎大家转载,请注明出处!码农打字不易,敬请谅解,谢谢!
参考最多:
官方参考地址
官方hue配置文件参考
一般参考
http://blog.cheyo.net/81.html