hive环境---安装系列五
来源:互联网 发布:爱易编程工具箱 编辑:程序博客网 时间:2024/06/08 07:35
承接安装系列hadoop,hbase环境
//hive 安装一个节点
1.上传tar包2.解压
tar -zxvf apache-hive-1.2.1-bin.tar.gz -C /itcast/
3.mkdir /itcast/hive-1.2.1/logs
4./itcast/hive-1.2.1/conf/hive-site.xml
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hive.querylog.location</name>
<value>/itcast/hive-1.2.1/logs</value>
</property>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://172.17.3.192:3306/hive?createDatabaseIfNotExist=true</value>
<description>JDBC connect string for a JDBC metastore</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.ConnectionUserName</name>
<value>root</value>
<description>username to use against metastore database</description>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>1111</value>
<description>password to use against metastore database</description>
</property>
<property>
<name>hive.aux.jars.path</name>
<value>
file:///itcast/hive-1.2.1/lib/hive-hbase-handler-1.2.1.jar,file:///itcast/hive-1.2.1/lib/hbase-client-1.1.4.jar,file:///itcast/hive-1.2.1/lib/hbase-common-1.1.4-tests.jar,file:///itcast/hive-1.2.1/lib/hbase-common-1.1.4.jar,file:///itcast/hive-1.2.1/lib/hbase-protocol-1.1.4.jar,file:///itcast/hive-1.2.1/lib/hbase-server-1.1.4.jar,file:///itcast/hive-1.2.1/lib/htrace-core-3.1.0-incubating.jar,file:///itcast/hive-1.2.1/lib/guava-14.0.1.jar,file:///itcast/hive-1.2.1/lib/zookeeper-3.4.6.jar</value>
</property>
<property>
<name>hive.zookeeper.quorum</name>
<value>centos1,centos2,centos3</value>
</property>
</configuration>
5.
先删除 $HIVE_HOME/lib 有以下jar
cp $HBASE_HOME/lib/hbase-client-1.0.0-cdh5.5.1.jar $HIVE_HOME/lib
cp $HBASE_HOME/lib/hbase-common-1.0.0-cdh5.5.1-tests.jar $HIVE_HOME/lib
cp $HBASE_HOME/lib/hbase-common-1.0.0-cdh5.5.1.jar $HIVE_HOME/lib
cp $HBASE_HOME/lib/hbase-protocol-1.0.0-cdh5.5.1.jar $HIVE_HOME/lib
cp $HBASE_HOME/lib/htrace-core-3.2.0-incubating.jar $HIVE_HOME/lib
cp $HBASE_HOME/lib/zookeeper-3.4.5-cdh5.5.1.jar $HIVE_HOME/lib
安装hive和mysq完成后,将mysql的连接jar包拷贝到$HIVE_HOME/lib目录下
如果出现没有权限的问题,在mysql授权(在安装mysql的机器上执行)
mysql -uroot -p
#(执行下面的语句 *.*:所有库下的所有表 %:任何IP地址或主机都可以连接)
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '1111' WITH GRANT OPTION;
FLUSH PRIVILEGES;
/itcast/hadoop-2.6.0/share/hadoop/yarn/lib/jline-0.9.94.jar
export JAVA_HOME=/usr/java/jdk1.7.0_45
export HIVE_HOME=/itcast/hive-1.2.1
export HADOOP_HOME=/itcast/hadoop-2.6.0
8.配置hive-env.sh
HADOOP_HOME=/itcast/hadoop-2.6.0
export HIVE_CONF_DIR=/itcast/hive-1.2.1/conf
9配置hive-log4j.properties
hive.log.dir=/itcast/hive-1.2.1/logs
10.mysql驱动放到hive/lib下
启动hive服务
hive --service hiveserver2 &
启动hive metastore 服务
hive --service metastore &
测试单节点Hbase的连接:
hive -hiveconf hbase.master=centos1:60000
DROP DATABASE IF EXISTS mondrian CASCADE;
测试集群Hbase的连接
hive -hiveconf hbase.zookeeper.quorum=centos1,centos2,centos3
登录mysql中hive库,tbls存储hive创建表信息,columns_v2表的列属性,sds表存储在哪里hdfs目录
建表(默认是内部表)
create table trade_detail(id bigint, account string, income double, expenses double, time string) row format delimited fields terminated by '\t';
建分区表
create table td_part(id bigint, account string, income double, expenses double, time string) partitioned by (logdate string) row format delimited fields terminated by '\t';
建外部表
create external table td_ext(id bigint, account string, income double, expenses double, time string) row format delimited fields terminated by '\t' location '/td_ext';
创建分区表
普通表和分区表区别:有大量数据增加的需要建分区表
create table book (id bigint, name string) partitioned by (pubdate string) row format delimited fields terminated by '\t';
分区表加载数据
load data local inpath './book.txt' overwrite into table book partition (pubdate='2010-08-22');
load data local inpath '/root/data.am' into table beauty partition (nation="USA");
select nation, avg(size) from beauties group by nation order by avg(size);
本地配置HADOOP_HOME、PATH hadoop-common-2.2.0-bin-master
- hive环境---安装系列五
- hadoop-企业版环境搭建(五)-安装Hive
- hive系列-hive安装
- 分布式Hive环境安装
- LAMP环境搭建系列之五:编译安装php5.6.32
- Hive 资料整理系列 五 Hive-0.5中SerDe概述
- hadoop+hbase+hive+Spark环境性能调优---安装系列九
- Hive环境、架构、搭建、安装
- Hive环境的安装部署
- 4.环境搭建-hive安装
- hadoop之hive环境安装
- hive on spark安装---安装系列七
- ArcSDE安装介绍系列五
- 从无到有系列之Hive-安装部署01
- hive报错---安装系列六
- Hive初学笔记(一) ---hive环境搭建与安装
- hive linux环境下的安装
- Hadoop 2.2.0 环境 HIVE 0.11安装
- 多线程同步问题-练习题3-笔记整理
- SpringBoot非官方教程 | 第十五篇:Springboot整合RabbitMQ
- AngularJS 组件化
- 基础反病毒工具入门系列
- 机器学习路线图(附资料)
- hive环境---安装系列五
- 【POJ2187】Beauty Contest-凸包+旋转卡壳
- python_movie_apriori
- java中的静态属性初始化--static块
- leetcode 566. Reshape the Matrix
- css3之pointer-events
- Contest Strategy
- 最大子矩阵 题解
- 如何解决ubutun中vi编辑器里面的显示行号,以及tab键占4位