hive-1.2.1的安装步骤

本篇内容主要讲解“hive-1.2.1的安装步骤”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“hive-1.2.1的安装步骤”吧!

为五指山等地区用户提供了全套网页设计制作服务,及五指山网站建设行业解决方案。主营业务为成都做网站、成都网站设计、五指山网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

环境介绍
IP主机名部署
192.168.2.10bi10
hadoop-2.6.2,hive-1.2.1,hive metastore
192.168.2.12bi12hadoop-2.6.2,hive-1.2.1,hive metastore
192.168.2.13bi13hadoop-2.6.2,hive-1.2.1
MySQL配置

    新建用户hive,密码hive,然后授权。数据库IP:192.168.2.11 端口:3306

CREATE USER 'hive'@'%' IDENTIFIED BY 'hive';
GRANT ALL PRIVILEGES ON *.* TO 'hive'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
CREATE DATABASE hive;
alter database hive character set latin1;
Hive配置

    解压hive-1.2.1到/home/hadoop/work/hive-1.2.1目录下,然后修改配置文件

    修改hive-site.xml,进入hive的conf目录下

[hadoop@bi13 conf]$ mv hive-env.sh.template hive-site.xml
[hadoop@bi13 conf]$ vim hive-site.xml

    hive-site.xml,参数说明:

hive.metastore.warehouse.dirhive数据仓库在hdfs中的位置,由于hadoop集群采用了ha的方式,所以在这里使用hdfs://masters/user/hive/warehouse,而没有具体的namenode主机+端口
hive.metastore.uris这个使用hive使用metastore server的端口配置,我们使用默认的9083端口
hive.exec.scratchdir同样,由于ha的配置,我们使用hdfs://masters/user/hive/tmp
javax.jdo.option.ConnectionPasswordmysql数据库密码
javax.jdo.option.ConnectionDriverNamemysql数据库驱动
javax.jdo.option.ConnectionURLmysql数据库URL
javax.jdo.option.ConnectionUserNamemysql数据库用户名

hive.querylog.location

hive.server2.logging.operation.log.location

hive.exec.local.scratchdir

hive.downloaded.resources.dir

这些配置项的value值必须写成具体的路径,否在会出现问题
<property>
  <name>hive.metastore.warehouse.dir</name>
  <value>hdfs://masters/user/hive/warehouse</value>
  <description>location of default database for the warehouse</description>
</property>
<property>
  <name>hive.metastore.uris</name>
  <value>thrift://bi10:9083,thrift://bi12:9083</value>
  <description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>
<property>
  <name>hive.exec.scratchdir</name>
  <value>hdfs://masters/user/hive/tmp</value>
  <description>HDFS root scratch dir for Hive jobs which gets created with write all (733) permission. For each connecting user, an HDFS scratch dir: ${hive.exec.scratchdir}/&lt;username&gt; is created, with ${hive.scratch.dir.permission}.</description>
</property>
<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>hive</value>
  <description>password to use against metastore database</description>
</property>
  <property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
  <description>Driver class name for a JDBC metastore</description>
</property>
  <property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://192.168.2.11:3306/hive?createDatabaseIfNotExist=true</value>
  <description>JDBC connect string for a JDBC metastore</description>
</property>
  <property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>hive</value>
  <description>Username to use against metastore database</description>
</property>

<property>
  <name>hive.querylog.location</name>
  <value>/home/hadoop/work/hive-1.2.1/tmp/iotmp</value>
  <description>Location of Hive run time structured log file</description>
</property>
  <property>
  <name>hive.server2.logging.operation.log.location</name>
  <value>/home/hadoop/work/hive-1.2.1/tmp/operation_logs</value>
  <description>Top level directory where operation logs are stored if logging functionality is enabled</description>
</property>
<property>
  <name>hive.exec.local.scratchdir</name>
  <value>/home/hadoop/work/hive-1.2.1/tmp/${system:user.name}</value>
  <description>Local scratch space for Hive jobs</description>
</property>
<property>
  <name>hive.downloaded.resources.dir</name>
  <value>/home/hadoop/work/hive-1.2.1/tmp/${hive.session.id}_resources</value>
  <description>Temporary local directory for added resources in the remote file system.</description>
</property>

    使用hive下面的jline-2.12.jar替代hadoop下面的jline-0.9.94.jar

mv hive-1.2.1/lib/jline-2.12.jar hadoop-2.6.2/share/hadoop/yarn/lib/
mv hadoop-2.6.2/share/hadoop/yarn/lib/jline-0.9.94.jar hadoop-2.6.2/share/hadoop/yarn/lib/jline-0.9.94.jar.bak

    把以上操作复制到所有部署hive的机器上

启动metastore service

    分别在bi10和bi12下面启动metastore service

nohup hive --service metastore > null 2>&1 &
测试

    进入hive,看是否有问题。如果存在问题是用hive --hiveconf hive.root.logger=DEBUG,console启动,可以看到具体的日志。

[hadoop@bi13 work]$ hive
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/work/hadoop-2.6.2/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/work/spark-1.5.1/lib/spark-assembly-1.5.1-hadoop2.4.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/work/hadoop-2.6.2/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/work/spark-1.5.1/lib/spark-assembly-1.5.1-hadoop2.4.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

Logging initialized using configuration in jar:file:/home/hadoop/work/hive-1.2.1/lib/hive-common-1.2.1.jar!/hive-log4j.properties
hive>

到此,相信大家对“hive-1.2.1的安装步骤”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

文章标题:hive-1.2.1的安装步骤
地址分享:https://www.cdcxhl.com/article44/igeihe.html

成都网站建设公司_创新互联,为您提供微信小程序网站排名虚拟主机App设计网站维护网站制作

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

外贸网站建设