cdh版本的hue安装配置部署以及集成hadoop hbase hive mysql等权威指南

hue下载地址https://github.com/cloudera/hue

hue学习文档地址http://archive.cloudera.com/cdh5/cdh/5/hue-3.7.0-cdh5.3.6/manual.html

我目前使用的是hue-3.7.0-cdh5.3.6

hue(HUE=Hadoop User Experience)

Hue是一个开源的Apache Hadoop UI系统,由Cloudera Desktop演化而来,最后Cloudera公司将其贡献给Apache基金会的Hadoop社区,它是基于Python Web框架Django实现的。

通过使用Hue我们可以在浏览器端的Web控制台上与Hadoop集群进行交互来分析处理数据,例如操作HDFS上的数据,运行MapReduce Job,执行Hive的SQL语句,浏览HBase数据库等等。

hue特点:

  能够支持各个版本的hadoop
  hue默认数据库:sql lite
  文件浏览器:对数据进行增删改查
  hue下载src包进行一次编译,二次编译,在这用的是已经一次编译

hue部署:

1、下载依赖包:yum源安装

sudo yum -y install ant asciidoc cyrus-sasl-devel cyrus-sasl-gssapi gcc gcc-c++ krb5-devel libtidy libxml2-devel libxslt-devel mvn mysql mysql-devel openldap-devel python-devel sqlite-devel openssl-devel  

sudo 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

2、解压hue tar包

  tar -zxvf hue-3.7.0-cdh5.3.6.tar.gz -C /指定的目录

3、二次编译

  进入hue目录:执行make apps  会出现个build目录

错误:(centos 7会有)
error: static declaration of ‘X509_REVOKED_dup’ follows non-static declaration
static X509_REVOKED * X509_REVOKED_dup(X509_REVOKED *orig) {
^
In file included from /usr/include/openssl/ssl.h:156:0,
from OpenSSL/crypto/x509.h:17,
from OpenSSL/crypto/crypto.h:30,
from OpenSSL/crypto/crl.c:3:
/usr/include/openssl/x509.h:751:15: note: previous declaration of ‘X509_REVOKED_dup’ was here
X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev);
^
error: command 'gcc' failed with exit status 1

给下面两个删掉:/usr/include/openssl/x509.h -》751、752行
X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev);
X509_REQ *X509_REQ_dup(X509_REQ *req);
##必须删掉,注释不行

4、进入到hue-3.7.0-cdh5.3.6/desktop/conf

配置hue.ini文件:

secret_key=jFE93j;2[290-eiw.KEiwN2s3['d;/.q[eIW^y#e=+Iei*@Mn<qW5o
http_host=hadoop01.xningge.com
http_port=8888
time_zone=Asia/Shanghai

5、启动hue

  两种方式

1-->cd build/env/bin---》./supervisor 
2-->build/env/bin/supervisor

 6、浏览器访问hue

  主机名+8888
  创建用户名和密码

hue和hadoop的组件配置

1、hdfs的配置

  在hdfs-site.xml中配置

<property>
  <name>dfs.webhdfs.enabled</name>
  <value>true</value>
</property>

 

  在core-site.xml中配置

  

<property>
  <name>hadoop.proxyuser.hue.hosts</name>
  <value>*</value>
</property>
<property>
  <name>hadoop.proxyuser.hue.groups</name>
  <value>*</value>
</property>

2、重新启动hdfs进程

  sbin/start-yarn.sh

3、hue配置

  [[hdfs_clusters]]
  # HA support by using HttpFs

[[[default]]]
# Enter the filesystem uri
fs_defaultfs=hdfs://hadoop01.xningge.com:8020

# NameNode logical name.
## logical_name=

# Use WebHdfs/HttpFs as the communication mechanism.
# Domain should be the NameNode or HttpFs host.
# Default port is 14000 for HttpFs.
webhdfs_url=http://hadoop01.xningge.com:50070/webhdfs/v1

# This is the home of your Hadoop HDFS installation
hadoop_hdfs_home=/opt/modules/cdh/hadoop-2.5.0-cdh5.3.6

# Use this as the HDFS Hadoop launcher script
hadoop_bin=/opt/modules/cdh/hadoop-2.5.0-cdh5.3.6/bin

# Change this if your HDFS cluster is Kerberos-secured
## security_enabled=false

# Default umask for file and directory creation, specified in an octal value.
## umask=022

# Directory of the Hadoop configuration
hadoop_conf_dir=/opt/modules/cdh/hadoop-2.5.0-cdh5.3.6/etc/hadoop

[[yarn_clusters]]

[[[default]]]
# Enter the host on which you are running the ResourceManager
resourcemanager_host=hadoop01.xningge.com

# The port where the ResourceManager IPC listens on
resourcemanager_port=8032

# Whether to submit jobs to this cluster
submit_to=True

# Resource Manager logical name (required for HA)
## logical_name=

# Change this if your YARN cluster is Kerberos-secured
## security_enabled=false

# URL of the ResourceManager API
resourcemanager_api_url=http://hadoop01.xningge.com:8088

# URL of the ProxyServer API
proxy_api_url=http://hadoop01.xningge.com:8088

# URL of the HistoryServer API
history_server_api_url=http://hadoop01.xningge.com:19888

eg:此配置都是伪分布式模式

4、启动hue服务

  build/env/bin/supervisor

hue与hive配置

1、hive配置

  在hive-site.xml配置

<property>
  <name>hive.server2.thrift.bind.host</name>
  <value>hadoop01.xningge.com</value>
</property>
<property>
  <name>hive.metastore.uris</name>
  <value>hadoop01.xningge.com:9083</value>
</property>

2、启动hive服务

  bin/hiveserver2 &

  bin/hive --service metastore &

3 、hue配置

  修改hue.ini文件

[beeswax]

# Host where HiveServer2 is running.
# If Kerberos security is enabled, use fully-qualified domain name (FQDN).
hive_server_host=hadoop01.xningge.com

# Port where HiveServer2 Thrift server runs on.
hive_server_port=10000

# Hive configuration directory, where hive-site.xml is located
hive_conf_dir=/opt/modules/cdh/hive-0.13.1-cdh5.3.6/conf

# Timeout in seconds for thrift calls to Hive service
server_conn_timeout=120

# Choose whether Hue uses the GetLog() thrift call to retrieve Hive logs.
# If false, Hue will use the FetchResults() thrift call instead.
## use_get_log_api=true

# Set a LIMIT clause when browsing a partitioned table.
# A positive value will be set as the LIMIT. If 0 or negative, do not set any limit.
## browse_partitioned_table_limit=250

# A limit to the number of rows that can be downloaded from a query.
# A value of -1 means there will be no limit.
# A maximum of 65,000 is applied to XLS downloads.
## download_row_limit=1000000

# Hue will try to close the Hive query when the user leaves the editor page.
# This will free all the query resources in HiveServer2, but also make its results inaccessible.
## close_queries=false

# Thrift version to use when communicating with HiveServer2
## thrift_version=5

hue与关系型数据库配置

[librdbms]
# The RDBMS app can have any number of databases configured in the databases
# section. A database is known by its section name
# (IE sqlite, mysql, psql, and oracle in the list below).

[[databases]]
# sqlite configuration.
[[[sqlite]]] //注意这里一定要取消注释
# Name to show in the UI.
nice_name=SQLite

# For SQLite, name defines the path to the database.
name=/opt/modules/hue-3.7.0-cdh5.3.6/desktop/desktop.db

# Database backend to use.
engine=sqlite

# Database options to send to the server when connecting.
# https://docs.djangoproject.com/en/1.4/ref/databases/
## options={}

# mysql, oracle, or postgresql configuration.

  ##注意:这里的数据不能改动,默认是hue的数据库

[[[mysql]]] //注意这里一定要取消注释
# Name to show in the UI.
nice_name="My SQL DB"

# For MySQL and PostgreSQL, name is the name of the database.
# For Oracle, Name is instance of the Oracle server. For express edition
# this is 'xe' by default.
name=sqoop//这个name是数据库表名

# Database backend to use. This can be:
# 1. mysql
# 2. postgresql
# 3. oracle
engine=mysql

# IP or hostname of the database to connect to.
host=hadoop01.xningge.com

# Port the database server is listening to. Defaults are:
# 1. MySQL: 3306
# 2. PostgreSQL: 5432
# 3. Oracle Express Edition: 1521
port=3306

# Username to authenticate with when connecting to the database.
user=xningge

# Password matching the username to authenticate with when
# connecting to the database.
password=???

# Database options to send to the server when connecting.
# https://docs.djangoproject.com/en/1.4/ref/databases/
## options={}

hue与zookeeper配置

  只需修改hue.ini文件
  host_ports=hadoop01.xningge.com:2181
  启动zookeeper:

hue与oozie的配置

修改:hue.ini文件
[liboozie]
oozie_url=http://hadoop01.xningge.com:11000/oozie

  如果没有出来的:
  修改:oozie-site.xml
  <property>
    <name>oozie.service.WorkflowAppService.system.libpath</name>
    <value>/user/oozie/share/lib</value>
  </property>

  到oozie目录下重新创建sharelib库:
  bin/oozie-setup.sh sharelib create -fs hdfs://hadoop01.xningge.com:8020 -locallib oozie-sharelib-4.0.0-cdh5.3.6-yarn.tar.gz
  启动oozie:bin/oozied.sh start

hue与hbase的配置

修改hue.ini文件:
hbase_clusters=(Cluster|hadoop01.xningge.com:9090)
hbase_conf_dir=/opt/cdh_5.3.6/hbase-0.98.6-cdh5.3.6/conf
修改hbase-site.xml,添加以下配置:
<property>
  <name>hbase.regionserver.thrift.http</name>
  <value>true</value>
</property>
<property>
  <name>hbase.thrift.support.proxyuser</name>
  <value>true</value>
</property>
启动hbase:
bin/start-hbase.sh
bin/hbase-daemon.sh start thrift

##hbase完全分布式
hbase_clusters=(Cluster1|hostname:9090,Cluster2|hostname:9090,Cluster3|hostname:9090)

 

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
### 回答1: CDH6.3中Hue配置可以通过以下步骤完成: 1. 安装CDH6.3集群,并在其中一台机器上安装Hue。 2. 配置Hue的数据库连接,可以选择MySQL作为Hue的元数据存储和用户认证数据库。在Hue配置文件中,设置以下参数: ``` [desktop] ... # Database settings ... engine=django.db.backends.mysql host=<MySQL服务器IP地址> port=<MySQL服务器端口> user=<MySQL用户名> password=<MySQL用户密码> name=<MySQL数据库名> ``` 3. 配置Hive的连接,可以通过以下步骤完成: (1)在Hue配置文件中,设置以下参数: ``` [hadoop] ... # Hive settings ... hive_server_host=<Hive服务器IP地址> hive_server_port=<Hive服务器端口> ``` (2)在Hive配置文件中,设置以下参数: ``` <property> <name>hive.server2.enable.doAs</name> <value>true</value> </property> <property> <name>hive.server2.authentication</name> <value>KERBEROS</value> </property> <property> <name>hive.server2.authentication.kerberos.principal</name> <value>hive/_HOST@<Kerberos域名></value> </property> <property> <name>hive.server2.authentication.kerberos.keytab</name> <value>/etc/security/keytabs/hive.service.keytab</value> </property> ``` 4. 配置HBase的连接,可以通过以下步骤完成: (1)在Hue配置文件中,设置以下参数: ``` [hbase] ... # HBase settings ... hbase_host=<HBase服务器IP地址> hbase_port=<HBase服务器端口> ``` (2)在HBase配置文件中,设置以下参数: ``` <property> <name>hbase.security.authentication</name> <value>kerberos</value> </property> <property> <name>hbase.security.authorization</name> <value>true</value> </property> <property> <name>hbase.rpc.engine</name> <value>org.apache.hadoop.hbase.ipc.SecureRpcEngine</value> </property> <property> <name>hbase.master.kerberos.principal</name> <value>hbase/_HOST@<Kerberos域名></value> </property> <property> <name>hbase.regionserver.kerberos.principal</name> <value>hbase/_HOST@<Kerberos域名></value> </property> <property> <name>hbase.rpc.protection</name> <value>authentication</value> </property> ``` 5. 配置Spark的连接,可以通过以下步骤完成: (1)在Hue配置文件中,设置以下参数: ``` [spark] ... # Spark settings ... spark_host=<Spark服务器IP地址> spark_port=<Spark服务器端口> ``` (2)在Spark的配置文件中,设置以下参数: ``` spark.authenticate=true spark.authenticate.secret=<Spark认证密钥> spark.master=yarn spark.eventLog.enabled=true spark.eventLog.dir=<Spark事件日志目录> ``` 6. 配置SparkSQL的连接,可以通过以下步骤完成: (1)在Hue配置文件中,设置以下参数: ``` [spark] ... # SparkSQL settings ... spark_sql_host=<SparkSQL服务器IP地址> spark_sql_port=<SparkSQL服务器端口> ``` (2)在SparkSQL的配置文件中,设置以下参数: ``` spark.authenticate=true spark.authenticate.secret=<SparkSQL认证密钥> spark.sql.catalogImplementation=hive ``` 7. 配置PySpark的连接,可以通过以下步骤完成: (1)在Hue配置文件中,设置以下参数: ``` [spark] ... # PySpark settings ... pyspark_host=<PySpark服务器IP地址> pyspark_port=<PySpark服务器端口> ``` (2)在PySpark的配置文件中,设置以下参数: ``` spark.authenticate=true spark.authenticate.secret=<PySpark认证密钥> ``` ### 回答2: CDH6.3是一款开源的大数据平台,它拥有众多的开源项目和工具,但是如果不能充分发挥这些工具的功能,即使搭建了CDH6.3也无法完成数据处理和分析任务。因此,在CDH6.3中,我们不仅需要熟悉各个组件的使用,还需要对它们进行配置,以满足我们的具体需求。 HueCDH6.3中非常流行的一个web界面,它提供了对各种Hadoop组件的操作,包括MySQLHiveHBase、Spark、SparkSQL和Pyspark。下面是它们的配置过程: MySQL配置:在Hue配置文件中,需要设置数据库连接信息,包括数据库类型、地址、端口、用户名和密码等。配置好后,就可以在Hue上操作MySQL数据库。 Hive配置:在Hue配置Hive相关配置需要设置一个元数据库,可以使用MySQL作为元数据存储库,配置还包括HDFS和YARN等相关配置。完成配置后,用户可以在Hue上运行Hive查询。 HBase配置:在Hue配置HBase需要配置HueHBase的一些参数,主要是关于HueHBase API的参数,以及Hue主机的HBase客户端配置。完成配置后,用户可以使用HBase浏览器在Hue上访问HBase。 Spark配置:在Hue集成Spark最直接的方法是通过Livy服务来连接Spark,配置需要指定Spark主机地址和端口等参数。配置好后,用户就可以在Hue上运行Spark任务。 SparkSQL配置:在Hue配置SparkSQL需要在LIVY服务中设置SparkSQL的执行环境参数。由于SparkSQL依赖于Spark集群,因此需要在Livy服务中指定Spark集群的信息。同时,需要为Hive配置一个metastore用于SparkSQL的元数据存储。 Pyspark配置Hue集成Pyspark与Spark配置类似,通过Livy服务连接Pyspark,需要指定Python路径和Pyspark程序路径等参数。 总之,通过Hue配置CDH6.3中的组件,可以使用户在Web界面上方便的操作和管理各个组件,提高数据处理和分析效率。 ### 回答3: CDH是一个基于Apache Hadoop生态系统的分布式数据处理平台。HueCDH平台上一个重要的Web UI的组件,提供了图形界面来管理大数据。在CDH6.3中,Hue配置涉及集成多个组件,包括MySQLHiveHBase、Spark、Spark SQL和PySpark。 集成MySQL: 1. 在Hue配置文件中,开启MySQL的支持,启用以下参数:[[database]],type=mysql,host=localhost,port=3306,user=hueuser,password=huepassword,name=huedb。 2. 在MySQL中创建一个Hue用户并授权,使用以下命令:CREATE USER 'hueuser'@'<Hue主机>' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON huedb.* TO 'hueuser'@'<Hue主机>'; 3. 在Hue服务器上安装MySQL JDK依赖项和MySQL客户端依赖项,运行以下命令: sudo yum install mysql-connector-java --skip-broken sudo yum install mysql --skip-broken 4. 重启Hue服务。 集成Hive: 1. 在Hue配置文件中,开启Hive的支持,启用以下参数:[[beeswax]],hive_server_host=localhost,hive_server_port=10000。 2. 配置Hive JDBC驱动程序,将hive-jdbc.jar拷贝到Hue服务器上,并在 /etc/hue/conf/hue.ini配置以下: [jdbc] # The JDBC driver to use to connect to Hive hive_jdbc_jar=/usr/hdp/current/hive-client/lib/hive-jdbc.jar 3. 重启Hue服务。 集成HBase: 1. 在Hue配置文件中,开启HBase的支持,启用以下参数:[[hbase]],hbase_clusters=CDHCluster,hbase_clusters_live=CDHCluster。 2. 将 HBase 配置文件复制到 Hue 安装目录 /etc/hue/conf.dist 的 /etc/hue/conf/ 目录中。 3. 使用以下命令指定HBASE_HOME环境变量: export HBASE_HOME=/usr/lib/hbase 4. 启动Hue服务。 集成Spark 和 Spark SQL: 1. 在Hue配置文件中,开启Spark和Spark SQL的支持,启用以下参数: [[spark]] livy_server_host=localhost livy_server_port=8998 [[sparksql]] pyspark_submit_args=--master yarn-cluster --deploy-mode client 2. 安装Livy服务器,Livy是Spark的REST接口,通过Livy可以远程提交Spark作业。Livy服务器和Spark集群必须安装在同一台服务器上。 3. 在/etc/hue/conf/hue.ini文件中配置Livy服务器信息: [livy] server_url=http://localhost:8998 4. 重启Hue服务。 集成PySpark: 1. 在Hue配置文件中,开启PySpark的支持,启用以下参数:[[spark]],enable_pyspark=true,pyspark_submit_args=--master yarn-cluster --deploy-mode client。 2. 修改spark-env.sh文件,打开该文件并配置以下参数: export PYTHONPATH=/usr/lib/spark/python/:/usr/lib/spark/python/lib/py4j-0.9-src.zip:/usr/lib/hue/tools/lib/python 3. 重启Hue服务。 通过以上步骤,CDH6.3中的Hue已经成功集成MySQLHiveHBase、Spark、Spark SQL和PySpark,用户可以使用Hue提供的Web UI来管理和查询大数据集群。
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

大数据爱好者社区

打赏是支持,也可以移步公众号。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值