centos(vm)下安装hive2.1.1单机模式(x86)

1.vm安装(略)

2.jdk安装(略)

3.hive安装

a.下载hive

http://mirrors.cnnic.cn/apache/hive/hive-2.1.1/

cd hive/

tar -zxvf apache-hive-2.1.1-bin.tar.gz

[root@namenode hive]# cd apache-hive-2.1.1-bin/

[root@namenode apache-hive-2.1.1-bin]# ll

b.修改环境变量

[root@namenode ~]# vi /etc/profile

#HIVE
export HIVE_HOME=/root/hive/apache-hive-2.1.1-bin
export PATH=$PATH:$HIVE_HOME/bin
"/etc/profile" 90L, 2123C written

wq!

[root@namenode ~]# source /etc/profile

3.修改配置文件

[root@namenode apache-hive-2.1.1-bin]# cd conf/


[root@namenode conf]# vi hive-site.xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
    <name>hive.metastore.warehouse.dir</name>
    <value>/root/hive/apache-hive-2.1.1-bin/warehouse</value>
    <description>location of default database for the warehouse</description>
</property>
<property>
   <name>javax.jdo.option.ConnectionURL</name>
   <value>jdbc:derby:/root/hive/apache-hive-2.1.1-bin/metastore_db;create=true</value>
   <description>JDBC connect string for a JDBC metastore</description>
</property>
</configuration>


4.初始化数据库

[root@namenode conf]# schematool -initSchema -dbType derby

which: no hbase in (.:/root/hadoop/hadoop-2.7.2/bin:/root/java/jdk1.8.0_77/bin:.:/root/hadoop/hadoop-2.7.2/bin:/root/java/jdk1.8.0_77/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/java/jdk1.8.0_77/bin:/root/bin:/root/java/jdk1.8.0_77/bin:/root/hive/apache-hive-2.1.1-bin/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/root/hive/apache-hive-2.1.1-bin/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/root/hadoop/hadoop-2.7.2/share/hadoop/common/lib/slf4j-log4j12-1.7.10.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.apache.logging.slf4j.Log4jLoggerFactory]
Metastore connection URL:        jdbc:derby:/root/hive/apache-hive-2.1.1-bin/metastore_db;create=true
Metastore Connection Driver :    org.apache.derby.jdbc.EmbeddedDriver
Metastore connection User:       APP
Starting metastore schema initialization to 2.1.0
Initialization script hive-schema-2.1.0.derby.sql
Initialization script completed

5.启动程序

[root@namenode conf]# mkdir -p /opt/hive-2.0.0/warehouse
[root@namenode conf]# chmod a+rwx /opt/hive-2.0.0/warehouse
[root@namenode conf]# hive
which: no hbase in (.:/root/hadoop/hadoop-2.7.2/bin:/root/java/jdk1.8.0_77/bin:.:/root/hadoop/hadoop-2.7.2/bin:/root/java/jdk1.8.0_77/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/java/jdk1.8.0_77/bin:/root/bin:/root/java/jdk1.8.0_77/bin:/root/hive/apache-hive-2.1.1-bin/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/root/hive/apache-hive-2.1.1-bin/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/root/hadoop/hadoop-2.7.2/share/hadoop/common/lib/slf4j-log4j12-1.7.10.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.apache.logging.slf4j.Log4jLoggerFactory]

Logging initialized using configuration in jar:file:/root/hive/apache-hive-2.1.1-bin/lib/hive-common-2.1.1.jar!/hive-log4j2.properties Async: true

Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
hive>
    >
    >
    >
    >
    > show databases;
OK
default
Time taken: 6.81 seconds, Fetched: 1 row(s)




  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值