hive启动命令

这篇具有很好参考价值的文章主要介绍了hive启动命令。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

bin/hive客户端

1、启动元数据管理服务(必须启动,否则无法工作)

        前台启动:bin/hive --service metastore

        后台启动:nohup bin/hive --service metastore >> logs/metastore.log 2>&1 &

2、启动客户端

        Hive Shell方式(可以直接写SQL): bin/hive

Last login: Sat May 27 08:10:46 2023
[root@node1 ~]# /export/server/hive/bin/hive
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.3-bin/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.3-bin/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Hive Session ID = 54980ee6-d20b-4382-b19f-473d7371bc48

Logging initialized using configuration in jar:file:/export/server/apache-hive-3.1.3-bin/lib/hive-common-3.1.3.jar!/hive-log4j2.properties Async: true
Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
Hive Session ID = 69151652-3030-496e-bf5f-d23e37b42a34
hive> show databases;
OK
default
Time taken: 0.558 seconds, Fetched: 1 row(s)

Beeline工具连接hiveserver2客户端

先启动metastore服务端,在启动hiveserver2客户端,最后启动Beeline工具连接客户端

1、启动metastore

2、启动hiveserver2

前台启动:bin/hive --service   hiveserver2

后台启动:nohup bin/hive --service hiveserver2 >> logs/hiveserver2.log 2>&1 &

3、启动Beeline

启动hive安装目录下的bin/beeline

[root@node1 ~]# /export/server/hive/bin/beeline 
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.3-bin/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/export/server/apache-hive-3.1.3-bin/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/export/server/hadoop-3.3.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Beeline version 3.1.3 by Apache Hive
beeline> !connect jdbc:hive2://node1:10000
Connecting to jdbc:hive2://node1:10000
Enter username for jdbc:hive2://node1:10000: root
Enter password for jdbc:hive2://node1:10000: 
Connected to: Apache Hive (version 3.1.3)
Driver: Hive JDBC (version 3.1.3)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://node1:10000> show databases;
INFO  : Compiling command(queryId=root_20230527082711_5729d7f2-3dfa-4bfc-a0e8-3202a3d321da): show databases
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:database_name, type:string, comment:from deserializer)], properties:null)
INFO  : Completed compiling command(queryId=root_20230527082711_5729d7f2-3dfa-4bfc-a0e8-3202a3d321da); Time taken: 0.77 seconds
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Executing command(queryId=root_20230527082711_5729d7f2-3dfa-4bfc-a0e8-3202a3d321da): show databases
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=root_20230527082711_5729d7f2-3dfa-4bfc-a0e8-3202a3d321da); Time taken: 0.02 seconds
INFO  : OK
INFO  : Concurrency mode is disabled, not creating a lock manager
+----------------+
| database_name  |
+----------------+
| default        |
+----------------+
1 row selected (1.267 seconds)
0: jdbc:hive2://node1:10000> use default;
INFO  : Compiling command(queryId=root_20230527082722_f32f03bb-0e82-435d-8765-199834588275): use default
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Semantic Analysis Completed (retrial = false)
INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)
INFO  : Completed compiling command(queryId=root_20230527082722_f32f03bb-0e82-435d-8765-199834588275); Time taken: 0.031 seconds
INFO  : Concurrency mode is disabled, not creating a lock manager
INFO  : Executing command(queryId=root_20230527082722_f32f03bb-0e82-435d-8765-199834588275): use default
INFO  : Starting task [Stage-0:DDL] in serial mode
INFO  : Completed executing command(queryId=root_20230527082722_f32f03bb-0e82-435d-8765-199834588275); Time taken: 0.012 seconds
INFO  : OK
INFO  : Concurrency mode is disabled, not creating a lock manager
No rows affected (0.062 seconds)
0: jdbc:hive2://node1:10000> 

正常启动后会出现表格形式展示hive中的数据库。而使用bin/hive方式启动客户端,不会以表格形式展示,使用Beeline方式比较可视化一些。

!connect jdbc:hive2://node1:10000 

beeline工具使用hive2协议连接hiveserver2客户端

node1为主机名称,由于我设置了主机映射,可以直接使用主机名,代替ip地址

10000为连接hiveserver2的10000端口

hive metastore启动,hive,hadoop,数据仓库文章来源地址https://www.toymoban.com/news/detail-589789.html

到了这里,关于hive启动命令的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 常见的bug---3、没有启动metaStore和Hiveserver2服务导致在本机上的IDEA无法连接上虚拟机上的HIve

    在IEDA连接虚拟机上的Hive报的 Exception in thread “main” org.apache.spark.sql.AnalysisException: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient at org.apache.spark.sql.hive.HiveExternalCatalog.withClient(HiveExternalCatalog.scala:11

    2024年02月15日
    浏览(41)
  • 访问 Hive 的元数据存储(MetaStore)的API方式

    访问 Hive 的元数据存储(MetaStore)的API方式 访问 Hive 的元数据存储(MetaStore)是通过 Hive 的 Thrift API 来实现的。Thrift 是一个跨语言的远程服务调用框架,它可以让不同编程语言之间进行跨语言的远程过程调用(RPC)。Hive 的元数据存储的 Thrift API 允许你通过编程语言(如 J

    2024年02月14日
    浏览(33)
  • Hadoop和hive一键启动脚本

       停止hadoop服务 停止hive服务  

    2024年02月16日
    浏览(34)
  • Hive Metastore 表结构

    Hive MetaStore 的ER 图如下。 部分表结构和说明。 CTLGS(CATALOGS) catalogs 可以隔离元数据。默认只有1行。一个 CATALOG 可以有多个数据库。 记录示例 DBS(数据库表) 每个数据库一条记录。 记录示例 TBLS(表记录) 表结构 记录示例 PARTITION_KEYS(表的分区字段) PARTITIONS(分区信息) 记录示例 可

    2024年02月13日
    浏览(66)
  • hive 架构及 metastore 功能简单介绍

    这两天在调研用 java 怎么能通过 hive metastore 将 hive 表中的数据读出来(不能用 hive2),最好是能直接支持 sql 查询。各种查跟尝试,最终确定这条路走不通。期间研究了下 hive 的内部架构,其实就是看了一遍官方文档。记录下怕忘了。 hive 中主要有两个组件 hive server2 和 hiv

    2024年02月11日
    浏览(30)
  • Hive的Metastore三种配置方式

    metastore 是 Hive 元数据的集中存放地。metastore 元数据存储主要体现在两个方面:服务和后台数据的存储。元数据包含用 Hive 创建的 database、table 等的元信息。元数据存储在关系型数据库中。如 Derby、MySQL 等。 客户端连接 metastore 服务,metastore 再去连接 MySQL 数据库来存取元数据

    2024年02月09日
    浏览(33)
  • hive 配置metastore hiveserver2服务开启

    hive-site.xml: hive-site.xml: hive-site.xml: 重启MetaStore服务: 启动hive服务: 启动后需要等待一段时间,jdbc才能连接上hive服务 使用beeline客户端验证是否可以连接:

    2024年02月03日
    浏览(32)
  • MySQL到TiDB:Hive Metastore横向扩展之路

    作者:vivo 互联网大数据团队 - Wang Zhiwen 本文介绍了vivo在大数据元数据服务横向扩展道路上的探索历程,由实际面临的问题出发,对当前主流的横向扩展方案进行了调研及对比测试,通过多方面对比数据择优选择TiDB方案。其次分享了整个扩展方案流程、实施遇到的问题及解决

    2024年02月07日
    浏览(31)
  • Hadoop历险记(七 Hive配置和启动hiveservice2服务)

    之前讲了hive的元数据,它存储着hiveSQL映射和hdfs具体文件数据的对应关系。 但是元数据存在单独的mysql中 直接将它暴露给外部是不安全的,所以hive特别增加了一个元数据服务。 它作为元数据和外部客户端之间的一个中间人。 metastore有三种服务配置模式 同时也可以说这是h

    2024年02月03日
    浏览(35)
  • 【运维】hive 高可用详解: Hive MetaStore HA、hive server HA原理详解;hive高可用实现

    Hive元数据存储在MetaStore中,包括表的定义、分区、表的属性等信息。 hive metastore 配置多台,可以避免单节点故障导致整个集群的hive client不可用。 原理如下: Active-active mode is not supported for Hive Metastore. Hence, there is one active instance of the Hive Metastore service at any given point in time.

    2024年02月02日
    浏览(34)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包