博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Hive环境搭建
阅读量:5840 次
发布时间:2019-06-18

本文共 4649 字,大约阅读时间需要 15 分钟。

 

hive 环境搭建需要hadoop的环境。hadoop环境的搭建不在这里赘述。参考:http://www.cnblogs.com/parkin/p/6952370.html

1.准备阶段

hive 官网下载 : 

2.解压缩

tar -zxvf apache-hive-2.1.1-bin.tar.gz -C /home/q/

3.hive 配置

  hive-env.sh 配置

cp hive-env.sh.template hive-env.shvi hive-env.sh #添加以下代码 export HADOOP_HOME=/home/q/hadoop-2.6.5 export HIVE_HOME=/home/q/apache-hive-2.1.1-bin

  hive-site.xml 配置

cp hive-site.xml.template hive-site.xml vi hive-site.xml #添加以下代码   
javax.jdo.option.ConnectionURL
jdbc:mysql://192.168.251.114:3306/hive?createDatabaseIfNotExist=true&characterEncoding=UTF-8
javax.jdo.option.ConnectionDriverName
com.mysql.jdbc.Driver
javax.jdo.option.DetachAllOnCommit
true
detaches all objects from session so that they can be used after transaction is committed
javax.jdo.option.NonTransactionalRead
true
reads outside of transactions
javax.jdo.option.ConnectionUserName
root
javax.jdo.option.ConnectionPassword
b6f3g2
javax.jdo.option.Multithreaded
true
Set this to true if multiple threads access metastore through JDO concurrently.
hive.metastore.warehouse.dir
/user/hive/warehouse
location of default database for the warehouse
hive.exec.scratchdir
/user/hive/scratch
hive.aux.jars.path
file:///home/q/apache-hive-2.1.1-bin/auxlib/json-serde-1.3.1-SNAPSHOT-jar-with-dependencies.jar,file:///home/q/apache-hive-2.1.1-bin/auxlib/qunar-udf.jar,file:///home/q/apache-hive-2.1.1-bin/auxlib/brickhouse-0.7.1-SNAPSHOT.jar,file:///home/q/apache-hive-2.1.1-bin/auxlib/joda-time-2.1.jar
hbase.zookeeper.quorum
localhost
hive.exec.dynamic.partition
true
hive.exec.dynamic.partition.mode
nostrict
hive.server2.thrift.port
12121
mapred.max.split.size
48000000
mapred.min.split.size.per.node
24000000
mapred.min.split.size.per.rack
24000000
hive.hadoop.supports.splittable.combineinputformat
true
hive.exec.max.dynamic.partitions.pernode
1000
hive.merge.mapredfiles
true
hive.merge.smallfiles.avgsize
32000000
hive.hadoop.supports.splittable.combineinputformat
true
hive.metastore.schema.verification
false
Enforce metastore schema version consistency. True: Verify that version information stored in metastore matches with one from Hive jars. Also disable automatic schema migration attempt. Users are required to manully migrate schema after Hive upgrade which ensures proper metastore schema migration. (Default) False: Warn if the version information stored in metastore doesn't match with one from in Hive jars.
hive.server2.long.polling.timeout
5000
Time in milliseconds that HiveServer2 will wait, before responding to asynchronous calls that use long polling

 

4.metastore 数据库初始化 

cd /home/q/apache-hive-2.1.1-bin/bin schematool -dbType mysql -initSchema

5. hive 启动

# CLI 交互式查询 hive 仓库 cd /home/q/apache-hive-2.1.1-bin/bin ./hive

6.hive metastore 服务启动 (主要用于hive client客户端的访问)

cd /home/q/apache-hive-2.1.1-bin/bin hive --service metastore # -p 
不指定该参数,则默认端口为9083#

 

7.hiveserver2 服务启动(主要用于rpc方式访问hive数据仓库的表)

cd /home/q/apache-hive-2.1.1-bin/bin./hiveserver2

 

转载于:https://www.cnblogs.com/parkin/p/7151591.html

你可能感兴趣的文章
记录一次蚂蚁金服前端电话面试
查看>>
直播源码开发视频直播平台,不得不了解的流程
查看>>
Ubuntu上的pycrypto给出了编译器错误
查看>>
聊聊flink的RestClientConfiguration
查看>>
在CentOS上搭建git仓库服务器以及mac端进行克隆和提交到远程git仓库
查看>>
測試文章
查看>>
Flex很难?一文就足够了
查看>>
【BATJ面试必会】JAVA面试到底需要掌握什么?【上】
查看>>
CollabNet_Subversion小结
查看>>
mysql定时备份自动上传
查看>>
17岁时少年决定把海洋洗干净,现在21岁的他做到了
查看>>
《写给大忙人看的java se 8》笔记
查看>>
倒计时:计算时间差
查看>>
Linux/windows P2V VMWare ESXi
查看>>
Windows XP倒计时到底意味着什么?
查看>>
运维工程师在干什么学些什么?【致菜鸟】
查看>>
Linux中iptables详解
查看>>
java中回调函数以及关于包装类的Demo
查看>>
maven异常:missing artifact jdk.tools:jar:1.6
查看>>
终端安全求生指南(五)-——日志管理
查看>>