安装
- 安装依赖包
1
2
3
4yum -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
--------
这个过程会有点久,安心等待
下载hue
1
2
3
4
5
6
7
8
9
10
11- 下载CDH版本的HUE
wget http://archive.cloudera.com/cdh5/cdh/5/hue-3.9.0-cdh5.7.0.tar.gz
- 解压
tar -zxf hue-3.9.0-cdh5.7.0.tar.gz -C /home/hadoop/app
cd /home/hadoop/app
mv hue-3.9.0-cdh5.7.0 hue
- 编译
cd hue
make apps
-------
make的时间也会稍微久一点配置环境变量
1
2
3
4
5
6vim ~/.bash_profile
export HUE_HOME=/home/hadoop/app/hue-3.9.0-cdh5.7.0
export PATH=$HUE_HOME/build/env/bin:$PATH
source ~/.bash_profile
配置文件修改
/hue/desktop/conf/hue.ini
desktop
1
2
3
4
5
6[desktop]
28 http_host=0.0.0.0 # 监听地址
29 http_port=8888 # 启动端口
30
31 # Time zone name
32 time_zone=Asia/Shanghai # 时区hadoop
1
2
3659 [hadoop]
668 fs_defaultfs=hdfs://hadoop001:8020
676 webhdfs_url=http://hadoop001:50070/webhdfs/v1yarn_clusters
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26690 [[yarn_clusters]]
691
692 [[[default]]]
693 # Enter the host on which you are running the ResourceManager
694 resourcemanager_host=hadoop001
695
696 # The port where the ResourceManager IPC listens on
697 ## resourcemanager_port=8032
698
699 # Whether to submit jobs to this cluster
700 submit_to=True
701
702 # Resource Manager logical name (required for HA)
703 ## logical_name=
704
705 # Change this if your YARN cluster is Kerberos-secured
706 ## security_enabled=false
707
708 # URL of the ResourceManager API
709 resourcemanager_api_url=http://hadoop001:8088
710
711 # URL of the ProxyServer API
712 proxy_api_url=http://hadoop001:8088
713
714 # URL of the HistoryServer API
715 history_server_api_url=http://hadoop001:19888hive
1
2
3
4
5
6
7
8
9
10
11772 [beeswax]
773
774 # Host where HiveServer2 is running.
775 # If Kerberos security is enabled, use fully-qualified domain name (FQDN).
776 hive_server_host=hadoop001
777
778 # Port where HiveServer2 Thrift server runs on.
779 hive_server_port=10000 # hiveserver2的启动端口,如果改了这里要同步
780
781 # Hive configuration directory, where hive-site.xml is located
782 hive_conf_dir=/home/hadoop/app/hive/conf #hive的conf目录mysql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
301217 ## [[[mysql]]]
1218 # Name to show in the UI.
1219 nice_name="My SQL DB"
1220
1221 # For MySQL and PostgreSQL, name is the name of the database.
1222 # For Oracle, Name is instance of the Oracle server. For express edition
1223 # this is 'xe' by default.
1224 name=mysqldb
1225
1226 # Database backend to use. This can be:
1227 # 1. mysql
1228 # 2. postgresql
1229 # 3. oracle
1230 engine=mysql
1231
1232 # IP or hostname of the database to connect to.
1233 host=hadoop001
1234
1235 # Port the database server is listening to. Defaults are:
1236 # 1. MySQL: 3306
1237 # 2. PostgreSQL: 5432
1238 # 3. Oracle Express Edition: 1521
1239 port=3306
1240
1241 # Username to authenticate with when connecting to the database.
1242 user=root
1243
1244 # Password matching the username to authenticate with when
1245 # connecting to the database.
1246 password=123456
Hadoop配置修改
hdfs-site.xml
1
2
3
4
5
6
7
8
9<property>
<name>dfs.webhdfs.enabled</name>
<value>true</value>
</property>
<property>
<name>dfs.permissions.enabled</name>
<value>false</value>
</property>core-site.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19<property>
<name>hadoop.proxyuser.hue.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hue.groups</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.hadoop.groups</name>
<value>*</value>
</property>yarn-site.xml
1
2
3
4
5
6
7
8
9
10
11<!--打开HDFS上日志记录功能-->
<property>
<name>yarn.log-aggregation-enable</name>
<value>true</value>
</property>
<!--在HDFS上聚合的日志最长保留多少秒。3天-->
<property>
<name>yarn.log-aggregation.retain-seconds</name>
<value>259200</value>
</property>httpfs-site.xml
1
2
3
4
5
6
7
8
9<property>
<name>httpfs.proxyuser.hue.hosts</name>
<value>*</value>
</property>
<property>
<name>httpfs.proxyuser.hue.groups</name>
<value>*</value>
</property>
Hive配置修改
- hive-site.xml
1
2
3
4
5
6
7
8
9
10
11<property>
<name>hive.metastore.uris</name>
<value>thrift://hadoop001:9083</value>
<description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>
<property>
<name>hive.server2.thrift.bind.host</name>
<value>hadoop001</value>
<description>Bind host on which to run the HiveServer2 Thrift service.</description>
</property>
相关程序启动
- 重启hdfs及yarn服务
- 启动hive的hiveserver2服务
HUE环境初始化及启动
1 | hue syncdb |
界面服务
- 浏览器访问
http://hadoop001:8888
- 登录页面:第一次登录会让我们配置用户名和密码,admin/admin即可
- 进来之后会有一堆报错,别方,不影响
右上角查看hdfs是否可用
左上角查看hive是否可用
都可用我们的目的就达到了,best wishes for you