Hive安装与配置详解

Hive安装与配置详解评论 6Hive 安装与配置详解 hive 安装和配置 hive 的测试 hive 安装和配置安装一 下载 hive 地址 http mirror bit edu cn apache hive 这里以 hive 2 1 1 为例子 如图 将 hive 解压到 usr local 下 root s100local tar zxvfapache hive 2 1 1 bin tar g

[root@s100 local]# tar -zxvf apache-hive-2.1.1-bin.tar.gz -C /usr/local/ 

将文件重命名为hive文件:

[root@s100 local]# mv apache-hive-2.1.1-bin hive 

在这里插入图片描述

修改环境变量/etc/profile:

[root@s100 local]# vim /etc/profile 1 #hive 2 export HIVE_HOME=/usr/local/hive 3 export PATH=$PATH:$HIVE_HOME/bin 
[root@s100 local]# hive --version 
[root@s100 conf]# cd /usr/local/hive/conf/ 
[root@s100 conf]# cp hive-default.xml.template hive-site.xml [root@s100 conf]# vim hive-site.xml 
 
   
   
   
   
    
    
    
    
    
    
    
      javax.jdo.option.ConnectionUserName 
    用户名(这4是新添加的,记住删除配置文件原有的哦!) 
    
      root 
     
    
    
    
      javax.jdo.option.ConnectionPassword 
    密码 
     
     
    
    
    
      javax.jdo.option.ConnectionURL 
    mysql 
    
      jdbc:mysql://192.168.1.68:3306/hive 
     
    
    
    
      javax.jdo.option.ConnectionDriverName 
    mysql驱动程序 
    
      com.mysql.jdbc.Driver 
     
    
    
    
    
      hive.exec.script.wrapper 
     
     
     
    
  

在这里插入图片描述
2.复制mysql的驱动程序到hive/lib下面(这里已经拷贝好了)

[root@s100 lib]# ll mysql-connector-java-5.1.18-bin.jar -rw-r--r-- 1 root root  1月 4 01:43 mysql-connector-java-5.1.18-bin.jar 

3.在mysql中hive的schema(在此之前需要创建mysql下的hive数据库)

 1 [root@s100 bin]# pwd 2 /usr/local/hive/bin 3 [root@s100 bin]# schematool -dbType mysql -initSchema 

4.执行hive命令

[root@localhost hive]# hive 

在这里插入图片描述
成功进入hive界面,hive配置完成
5.查询mysql(hive这个库是在 schematool -dbType mysql -initSchema 之前创建的!)




 1 [root@localhost ~]# mysql -uroot -p 2 Welcome to the MySQL monitor. Commands end with ; or \g. 3 Your MySQL connection id is 10 4 Server version: 5.1.73 Source distribution 5 6 Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. 7 8 Oracle is a registered trademark of Oracle Corporation and/or its 9 affiliates. Other names may be trademarks of their respective 10 owners. 11 12 Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 13 14 mysql> use hive 15 Reading table information for completion of table and column names 16 You can turn off this feature to get a quicker startup with -A 17 18 Database changed 19 mysql> show tables; 20 +---------------------------+ 21 | Tables_in_hive | 22 +---------------------------+ 23 | AUX_TABLE | 24 | BUCKETING_COLS | 25 | CDS | 26 | COLUMNS_V2 | 27 | COMPACTION_QUEUE | 28 | COMPLETED_COMPACTIONS | 

 
    
    
    
     
     
       javax.jdo.option.ConnectionURL 
      
     
       jdbc:mysql://localhost:3306/hahive 
     (mysql地址localhost) 
     
     
     
       javax.jdo.option.ConnectionDriverName 
     (mysql的驱动) 
     
       com.mysql.jdbc.Driver 
      
     
     
     
       javax.jdo.option.ConnectionUserName 
     (用户名) 
     
       root 
      
     
     
     
       javax.jdo.option.ConnectionPassword 
     (密码) 
      
      
     
     
     
       hive.metastore.schema.verification 
      
     
       false 
      
     
    

[root@localhost conf]# hadoop fs -lsr / 

2.进入hive并创建一个测试库和测试表

[root@localhost conf]# hive 

创建库:

1 hive> create database hive_1; 2 OK 3 Time taken: 1.432 seconds 显示库: 1 hive> show databases; 2 OK 3 default 4 hive_1 5 Time taken: 1.25 seconds, Fetched: 2 row(s) 
1 mysql> use hahive; 
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/201027.html原文链接:https://javaforall.net

(0)
上一篇 2026年3月20日 上午10:05
下一篇 2026年3月20日 上午10:06


相关推荐

  • html5 sexteen,Female Singaporean teacher jailed for teen sex

    html5 sexteen,Female Singaporean teacher jailed for teen sexAfemaleSingaporeanteacherwhohadsexwithaminorstudentwassentencedfortenmonthsinjailonMonday,localmediareported.AccordingtoChineselanguagenewspaperLianheZaobao,the32-year-ol…

    2022年5月10日
    50
  • django菜鸟教程用pycharm_runoob菜鸟教程官网

    django菜鸟教程用pycharm_runoob菜鸟教程官网Django安装以及简单项目创建(被django支配的恐惧)django简介python中有许多web框架,django无疑是一位S级选手,django是一个开放源代码的web框架,是由python写成的一个web框架.安装在安装django的同时,怎么能没有python呢django和python不可分割的一对基友,路径如下:python下载路径:https://www.pytho…

    2025年10月9日
    5
  • VS2005清理VAssist插件「建议收藏」

    VS2005清理VAssist插件「建议收藏」VAssist卸载不彻底的情况下,导致注册表残留,VS2005总是去加载VAssist插件。通过搜索注册表里面的Addins来手动删除[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\8.0\Addins]…

    2026年2月21日
    7
  • 机器学习sklearn之支持向量回归(SVR)

    机器学习sklearn之支持向量回归(SVR)SVM除了具有线性分类和非线性分类之外,还支持回归(SVR)。与传统的回归问题有所不同,在定义损失的时候,容忍f(x)与y之间有一定的偏差,具体推导过程如下图。由于回归问题引入了容忍偏差,松弛变量,式子相较于SVM分类更复杂一些,但是总体的求解思路是一致的,包括:定义目标函数、目标函数转换为无约束优化问题、对偶问题、SMO求解α,根据KKT条件找支持向量并计算b。上图中把W带入化简过程已省略,感…

    2022年5月31日
    282
  • vue 父传子 子传父实现方式

    vue 父传子 子传父实现方式父传子 主要步骤 首先在子组件 props 中创建一个属性 用以接收父组件传过来的值 然后父组件中引用子组件 并在子组件标签中添加子组件 props 中创建的属性 最后把需要传给子组件的值赋给该属性 理解 父亲传给儿子东西 儿子在那边用一个碗接 这个碗就是 props 因为传的东西不可能只是一个 所以是一个数组 父亲因为要传东西到儿子的碗里 所以要绑定儿子的碗 然后传值 props properties 的简称 prop 只可以从上一级组件传递到下一级组件 父子组件

    2026年3月18日
    1
  • 微信小程序下拉刷新问题

    微信小程序下拉刷新问题微信小程序下拉刷新问题 nbsp nbsp nbsp nbsp nbsp nbsp nbsp 我们主要来说一下微信小程序的下拉刷新问题 这个问题也是我自己碰见的问题 问题比较二 但是又很恶心 所以在这里给大家分享一下 有这个问题朋友 赶紧从死胡同里出来 nbsp nbsp nbsp nbsp nbsp nbsp nbsp 大家在做微信小程序

    2026年3月19日
    1

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号