赞
踩
前提概要:hue官网安装内容比较简单,可能由于版本的原因,各位博主的安装步骤不太适用,故写该文章供网友参考。hue的安装采用了该博主https://blog.csdn.net/qqqq0199181/article/details/85054161。
下载hue相关所有的rpm安装包(共15个),地址:http://archive.cloudera.com/cdh5/redhat/7/x86_64/cdh/5.15.1/RPMS/x86_64/
rpm –ivh –nodeps **.rpm
注意:逐个安装rpm包,注意hue-beeswax 放在最后一个安装,否则编译的时候python会报import Error
安装结束后进入hue目录(默认为/usr/local/hue)下执行
make apps
这里编译会提示确实两个文件,直接从其他机器上拷贝过来
- scp /usr/lib64/libxslt.so.1 root@10.3.68.127:/usr/lib64/libxslt.so.1
- scp /usr/lib64/libexslt.so.0 root@10.3.68.127:/usr/lib64/libexslt.so.0
如果其他机器上找不到就去网上下载。
- cd /usr/lib/hue/build/env/bin
- ./supervisor
访问8888端口打开hue的页面,输入用户名和密码(hue/hue,root/root)登录
hdfs-site.xml文件内容
- <!-- 启用WebHdfs. -->
- <property>
- <name>dfs.webhdfs.enabled</name>
- <value>true</value>
- </property>
- <property>
- <name>dfs.permissions</name>
- <value>false</value>
- </property>
core-site.xml文件配置
- <!-- Hue配置 -->
- <property>
- <name>hadoop.proxyuser.root.hosts</name>
- <value>*</value>
- </property>
- <property>
- <name>hadoop.proxyuser.root.groups</name>
- <value>*</value>
- </property>
- [hadoop]
- [[hdfs_clusters]]
- [[[default]]]
- fs_defaultfs=hdfs://node04:9000
- webhdfs_url=http://node04:50070/webhdfs/v1
- hadoop_conf_dir=/root/hadoop-2.7.7/etc/hadoop
- hadoop_hdfs_home=/root/hadoop-2.7.7
- hadoop_bin=/root/hadoop-2.7.7/bin
core-site配置中的root需要和hue.ini中的用户一致,hue.ini默认为hue用户和组,我全部修改为root
- [desktop]
- server_user=root
- server_group=root
- default_user=root
- default_hdfs_superuser=root
登录hue页面,打开file browser页面查看是否显示HDFS内容
配置mapred-site.xml
- <configuration>
- <property>
- <name>mapreduce.framework.name</name>
- <value>yarn</value>
- </property>
- </configuration>
配置yarn-site.xml
- <configuration>
- <property>
- <name>yarn.nodemanager.aux-services</name>
- <value>mapreduce_shuffle</value>
- </property>
- <property>
- <name>yarn.resourcemanager.hostname</name>
- <value>node04</value>
- </property>
- <!-- historyserver############ -->
- <property>
- <name>yarn.log-aggregation-enable</name>
- <value>true</value>
- </property>
- <property>
- <name>yarn.log-aggregation.retain-seconds</name>
- <value>106800</value>
- </property>
- <!-- historyserver############ -->
- </configuration>
- [[yarn_clusters]]
- [[[default]]]
- resourcemanager_host=node04
- resourcemanager_port=8032
- submit_to=True
- resourcemanager_api_url=http://node04:8088
- proxy_api_url=http://node04:8088
- history_server_api_url=http://node04:19888
进入hadoop目录,执行如下语句(HDFS中需要存在input目录,不存在output目录)
hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.7.jar wordcount /input /output
打开8088页面,通过mapreduce页面查看是否显示该任务,再登录hue页面查看job页面是否显示该任务信息
配置hive/conf/hive-site.xml
- <property>
- <name>hive.server2.thrift.port</name>
- <value>10000</value>
- </property>
- <property>
- <name>hive.server2.thrift.bind.host</name>
- <value>node04</value>
- </property>
- <property>
- <name>hive.server2.long.polling.timeout</name>
- <value>5000</value>
- </property>
- <property>
- <name>hive.metastore.uris</name>
- <value>thrift://node04:9083</value>
- </property>
- <property>
- <name>hive.server2.transport.mode</name>
- <value>http</value>
- </property>
- [beeswax]
- hive_server_host=node04
- hive_server_port=10000
- hive_conf_dir=/usr/local/hive/conf
启动hive服务
- bin/hive --service metastore
- bin/hive --service hiveserver2
hive/conf目录导入mysql连接包
mysql-connector-java-5.1.47.jar
配置hive/conf/hive-site.xml(xml配置中&需要使用&分割)
- <property>
- <name>hive.metastore.local</name>
- <value>false</value>
- </property>
- <property>
- <name>javax.jdo.option.ConnectionURL</name>
- <value>jdbc:mysql://127.0.0.1:3306/hive?characterEncoding=UTF-8&useSSL=false</value>
- <!--这里的hive13代表着在mysql中已经创建了一个叫hive13的数据库,如果mysql中没有这么一个数据库会报错-->
- </property>
- <property>
- <name>javax.jdo.option.ConnectionDriverName</name>
- <value>com.mysql.jdbc.Driver</value>
- </property>
- <property>
- <name>javax.jdo.option.ConnectionUserName</name>
- <value>root</value>
- </property>
- <property>
- <name>javax.jdo.option.ConnectionPassword</name>
- <value>Rule@123</value><!-- 这里是数据库密码 -->
- </property>
- mysql-community rpm安装包总共包含12个
- mysql-community-client-5.7.23-1.el7.x86_64.rpm,
- mysql-community-common-5.7.23-1.el7.x86_64.rpm,
- mysql-community-devel-5.7.23-1.el7.x86_64.rpm,
- mysql-community-embedded-5.7.23-1.el7.x86_64.rpm,
- mysql-community-embedded-compat-5.7.23-1.el7.x86_64.rpm,
- mysql-community-embedded-devel-5.7.23-1.el7.x86_64.rpm,
- mysql-community-libs-5.7.23-1.el7.x86_64.rpm,
- mysql-community-libs-compat-5.7.23-1.el7.x86_64.rpm,
- mysql-community-minimal-debuginfo-5.7.23-1.el7.x86_64.rpm,
- mysql-community-server-5.7.23-1.el7.x86_64.rpm,
- mysql-community-server-minimal-5.7.23-1.el7.x86_64.rpm,
- mysql-community-test-5.7.23-1.el7.x86_64.rpm
注意:mysql安装不全的话,启动hue会出现错误
- [librdbms]
- [[databases]]
- [[[mysql]]]
- nice_name="My SQL DB"
- engine=mysql
- host=node04
- port=3306
- user=root
- password=Rule@123
- cd /usr/lib/hue/build/env/bin
- ./hue syncdb
- ./hue migrate
结束语:由于hue集成组件比较多,安装组件较少的情况下,容易出现端口访问不同的情况,注意关注各个部分的端口使用情况。(yarn-8088,hive-10000,hdfs-50070,mysql-3306)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。