hive安装

hive安装

1      集群规划

1.1   软件包

mysql

apache-hive-2.1.1-bin.tar.gz

mysql-connector-java-5.1.40.zip

1.2   物理部署

Hadoop-master1

192.168.2.100

Mysql/hive

 

 

 

2      mysql设置

2.1   root用户设置

在安装之初,root用户没有密码。为了安全起见,需要设置root密码。

mysqladmin –u root password 1234

2.2   创建用户hive并设置权限

create user “hive”@”localhost” identifiedby “1234”;

grant all on *.* to “hive”@”localhost” ;

2.3   创建数据库

create database hivemeta;

2.4   其他数据库操作,请参考其他资料

3      集群目录创建

hdfs dfs –mkdir /tmp

hdfs dfs –mkdir /user

hdfs dfs –mkdir /user/hive

hdfs dfs –mkdir /user/hive/warehouse

hdfs dfs –chmod g+w /tmp

hdfs dfs –chmod g+w /user/hive/warehouse

4      hive安装步骤

4.1   创建目录并上传文件

mkdir ~/hive

将apache-hive-2.1.1-bin.tar.gz上传并解压

将mysql-connector-java-5.1.40.zip上传并解压

4.2   配置文件重命名

cd ~/hive/apache-hive-2.1.1-bin/conf

cp hive-env.sh.template hive-env.sh

cp hive-default.xml.template hive-site.xml

cp hive-log4j2.properties.templatehive-log4j2.properties

cp hive-exec-log4j2.properties.templatehive-exec-log4j2.properties

4.3   hive-env.sh

4.4   hive-site.xml

替换hive-site.xml文件中的 ${system:java.io.tmpdir} 和 ${system:user.name}

注意一项:在集群中的位置这个是在hdfs中设置的看3

<property>

<name>hive.metastore.warehouse.dir</name>

<value>/usr/hive/warehouse</value>

</property>

 

4.5   元数据库配置

4.5.1  驱动更新

将mysql-connector-java-5.1.39.jar 拷贝到~/hive/apache-hive-2.1.1-bin/lib

4.5.2  在hive-env.sh配置mysql数据库连接

<property>

<name>javax.jdo.option.ConnectionURL</name>

<value>jdbc:mysql://localhost:3306/hivemeta?createDatabaseIfNotExist=true</value>

</property>

<property>

<name>javax.jdo.option.ConnectionDriverName</name>

<value>com.mysql.jdbc.Driver</value>

</property>

<property>

<name>javax.jdo.option.ConnectionUserName</name>

<value>hive</value>

</property>

 

<property>

<name>javax.jdo.option.ConnectionPassword</name>

<value>1234</value>

</property>

 

4.6   修改.bash_profile将hive的命令添加到路径中

 

5      启动

5.1   初始化

schematool –dbType mysql –initSchema

5.2   常用命令

hive

 

6      遇到的问题,以及解决方法

在使用过程中遇到问题时需要修改配置文件,在附加中一一说明

6.1   Caused by:MetaException(message:Version information not found in metastore. )”

安装Hive 过程中要注意

 

1,MySQL 是否正常运行

2.   创建好mysql 用户并分配好相应的访问权限以及数据库端口号等

3.  mysql-connector-Java-5.1.26-bin.jar 是否放到hive/lib 目录下建议修改权限为777 (chmod 777 mysql-connector-java-5.1.26-bin.jar)

4. 修改conf/hive-site.xml 中的 “hive.metastore.schema.verification”  值为 false  即可解决 “Caused by:MetaException(message:Version information not found in metastore. )”

5. 调试 模式命令  hive -hiveconf hive.root.logger=DEBUG,console

 

<property> 

  <name>hive.metastore.schema.verification</name> 

  <value>false</value> 

   <description> 

   Enforce metastore schema version consistency. 

   True: Verify that version information stored in metastore matches withone from Hive jars.  Also disableautomatic schema migration attempt. Users are required to manully migrateschema after Hive upgrade which ensures proper metastore schema migration.(Default) 

   False: Warn if the version information stored in metastore doesn't matchwith one from in Hive jars. 

   </description> 

 </property>  

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值