hive安装

su - hadoop
xftp打开/home/hadoop/soft
上传

tar -xvf apache-hive-1.2.2-bin.tar.gz
mv apache-hive-1.2.2-bin …/install/hive

cd /home/hadoop/install/hive

修改环境变量
vim /etc/profile

export JAVA_HOME=/usr/local/jdk
export HADOOP_HOME=/home/hadoop/install/hadoop-2.7.4
export MYSQL_HOME=/usr/local/mysql
export HIVE_HOME=/home/hadoop/install/hive
export PS1="[\u@\h \w]$"
export PATH= P A T H : PATH: PATH:JAVA_HOME/bin: H A D O O P H O M E / b i n : HADOOP_HOME/bin: HADOOPHOME/bin:HADOOP_HOME/sbin: M Y S Q L H O M E / b i n : MYSQL_HOME/bin: MYSQLHOME/bin:HIVE_HOME/bin

source /etc/profile

HIVE存放元数据(将HDFS文件,映射为HIVE里面的表结构定义信息—>元数据信息)
数据是存储在HDFS上的
但是元数据信息derby mysql

HIVE—>MYSQL需要JDBC的支持,我们需要把JDBC包拷贝到hive/lib目录下
cp /home/hadoop/soft/mysql-connector-java-5.1.38.jar /home/hadoop/install/hive/lib

MySQL赋权操作

create database hive default character set latin1;
grant all on . to ‘hive’@’%’ identified by ‘hive’;
flush privileges;

mysql> create database hive default character set latin1;
Query OK, 1 row affected (0.04 sec)

mysql> grant all on . to ‘hive’@’%’ identified by ‘hive’;
Query OK, 0 rows affected (0.04 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.03 sec)

mysql> select user,host,password from mysql.user;
±-----±----------±------------------------------------------+
| user | host | password |
±-----±----------±------------------------------------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | % | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| hive | % | *4DF1D66463C18D44E3B001A8FB1BBFBEA13E27FC |
±-----±----------±------------------------------------------+
3 rows in set (0.00 sec)


默认模板文件
hive-default.xml.template

vim /home/hadoop/install/hive/conf/hive-site.xml

<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the “License”); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
–>

javax.jdo.option.ConnectionURL jdbc:mysql://192.168.2.10:3306/hive?characterEncoding=UTF-8 javax.jdo.option.ConnectionDriverName com.mysql.jdbc.Driver javax.jdo.option.ConnectionUserName hive javax.jdo.option.ConnectionPassword hive hive.metastore.warehouse.dir /usr/hive/warehouse hive.metastore.local true

======================================================================
source /etc/profile

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值