hive 服务 matastore服务

本文详细描述了在Hadoop集群中部署HiveMetastore服务器,包括使用scp命令传输文件、配置metastore服务器和客户端,以及在不同模式下的行为。还讨论了Metastore客户端如何优先连接Metastore服务器而非JDBC。
摘要由CSDN通过智能技术生成

在这里插入图片描述

嵌入式模式
在这里插入图片描述

独立服务模式
在这里插入图片描述

在这里插入图片描述

部署

在这里插入图片描述
在这里插入图片描述

本次实验在Hadoop102部署metastore服务器,在Hadoop103部署metastore客户端
hadoop102

[atguigu@hadoop102 conf]$ scp -r /opt/module/apache-hive-3.1.3-bin/ hadoop103:/opt/module/
RELEASE_NOTES.txt                                                      100%  540   369.9KB/s   00:00    
LICENSE                                                                100%   20KB  12.3MB/s   00:00    
NOTICE                                                                 100%  230   213.0KB/s   00:00    
org.jruby-LICENSE                                                      100% 1023   679.5KB/s   00:00    
com.ibm.icu.icu4j-LICENSE                                              100%   19KB  12.1MB/s   00:00    
org.codehaus.janino-LICENSE                                            100% 1562     1.8MB/s   00:00    

启动metastore服务器
[atguigu@hadoop102 conf]$ nohup hive --service metastore &
[2] 12927
[atguigu@hadoop102 conf]$ nohup: 忽略输入并把输出追加到"nohup.out"

[atguigu@hadoop102 conf]$ jps -ml
7968 org.apache.hadoop.yarn.server.nodemanager.NodeManager
8800 org.apache.hadoop.util.RunJar /opt/module/apache-hive-3.1.3-bin/lib/hive-service-3.1.3.jar org.apache.hive.service.server.HiveServer2
7682 org.apache.hadoop.hdfs.server.datanode.DataNode
7507 org.apache.hadoop.hdfs.server.namenode.NameNode
2971 org.apache.hadoop.mapreduce.v2.hs.JobHistoryServer
13068 sun.tools.jps.Jps -ml
12927 org.apache.hadoop.util.RunJar /opt/module/apache-hive-3.1.3-bin/lib/hive-metastore-3.1.3.jar org.apache.hadoop.hive.metastore.HiveMetaStore
[atguigu@hadoop102 conf]$ 





hadoop103


[atguigu@hadoop103 module]$ cd apache-hive-3.1.3-bin/conf/
[atguigu@hadoop103 conf]$ pwd
/opt/module/apache-hive-3.1.3-bin/conf
[atguigu@hadoop103 conf]$ vim hive-site.xml
[atguigu@hadoop103 conf]$ cat  hive-site.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>

	<property>
		<name>hive.metastore.warehouse.dir</name>
		<value>/user/hive/warehouse</value>
	</property>

<!-- 指定hiveserver2连接的host -->
	<property>
		<name>hive.server2.thrift.bind.host</name>
		<value>hadoop102</value>
	</property>

<!-- 指定hiveserver2连接的端口号 -->
	<property>
		<name>hive.server2.thrift.port</name>
		<value>10000</value>
	</property>

<!-- 指定metastore服务的地址 -->
	<property>
		<name>hive.metastore.uris</name>
		<value>thrift://hadoop102:9083</value>
	</property>

</configuration>

[atguigu@hadoop103 conf]$ cd ../
[atguigu@hadoop103 apache-hive-3.1.3-bin]$ pwd
/opt/module/apache-hive-3.1.3-bin

启动metastore客户端
[atguigu@hadoop103 apache-hive-3.1.3-bin]$ bin/hive
which: no hbase in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/module/jdk1.8.0_241/bin:/opt/module/hadoop-3.3.4/bin:/opt/module/hadoop-3.3.4/sbin:/home/atguigu/.local/bin:/home/atguigu/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/module/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:/opt/module/hadoop-3.3.4/share/hadoop/common/lib/slf4j-reload4j-1.7.36.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 = 674a898a-3637-410f-a8c2-89f83a518b37

Logging initialized using configuration in jar:file:/opt/module/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 = 2414a6ef-37df-469d-a17d-3693944d2efc
hive> show databases;
OK
default
Time taken: 0.473 seconds, Fetched: 1 row(s)
hive> select * from stu;
OK
1	ss
1	ss
2	0421
3	0421-1
Time taken: 1.421 seconds, Fetched: 4 row(s)
hive> quit;
[atguigu@hadoop103 apache-hive-3.1.3-bin]$ 



关闭metastore服务

[atguigu@hadoop102 conf]$ jps -ml
7968 org.apache.hadoop.yarn.server.nodemanager.NodeManager
8800 org.apache.hadoop.util.RunJar /opt/module/apache-hive-3.1.3-bin/lib/hive-service-3.1.3.jar org.apache.hive.service.server.HiveServer2
7682 org.apache.hadoop.hdfs.server.datanode.DataNode
7507 org.apache.hadoop.hdfs.server.namenode.NameNode
13251 sun.tools.jps.Jps -ml
2971 org.apache.hadoop.mapreduce.v2.hs.JobHistoryServer
12927 org.apache.hadoop.util.RunJar /opt/module/apache-hive-3.1.3-bin/lib/hive-metastore-3.1.3.jar org.apache.hadoop.hive.metastore.HiveMetaStore
[atguigu@hadoop102 conf]$ kill -9 12927
[atguigu@hadoop102 conf]$ 



如果metastore客户端同时配置jdbc和metastore服务器地址,metastore客户端只会访问服务器,而不是jdbc;

[atguigu@hadoop103 apache-hive-3.1.3-bin]$ bin/hive
which: no hbase in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/module/jdk1.8.0_241/bin:/opt/module/hadoop-3.3.4/bin:/opt/module/hadoop-3.3.4/sbin:/home/atguigu/.local/bin:/home/atguigu/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/module/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:/opt/module/hadoop-3.3.4/share/hadoop/common/lib/slf4j-reload4j-1.7.36.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 = 69183233-e1c6-4600-9a34-7175ab210632

Logging initialized using configuration in jar:file:/opt/module/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> select * from stu;
FAILED: HiveException java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
hive> quit;
[atguigu@hadoop103 apache-hive-3.1.3-bin]$ 

metastore服务器未开启,该设备hive客户端正常使用;

[atguigu@hadoop102 conf]$ jps -ml
7968 org.apache.hadoop.yarn.server.nodemanager.NodeManager
8800 org.apache.hadoop.util.RunJar /opt/module/apache-hive-3.1.3-bin/lib/hive-service-3.1.3.jar org.apache.hive.service.server.HiveServer2
7682 org.apache.hadoop.hdfs.server.datanode.DataNode
7507 org.apache.hadoop.hdfs.server.namenode.NameNode
13251 sun.tools.jps.Jps -ml
2971 org.apache.hadoop.mapreduce.v2.hs.JobHistoryServer
12927 org.apache.hadoop.util.RunJar /opt/module/apache-hive-3.1.3-bin/lib/hive-metastore-3.1.3.jar org.apache.hadoop.hive.metastore.HiveMetaStore
[atguigu@hadoop102 conf]$ kill -9 12927
[atguigu@hadoop102 conf]$ hive
which: no hbase in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/module/jdk1.8.0_241/bin:/opt/module/hadoop-3.3.4/bin:/opt/module/hadoop-3.3.4/sbin:/opt/module/apache-hive-3.1.3-bin/bin:/home/atguigu/.local/bin:/home/atguigu/bin)
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/module/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:/opt/module/hadoop-3.3.4/share/hadoop/common/lib/slf4j-reload4j-1.7.36.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 = 9c2b5790-8088-40fb-af0a-0890945f050e

Logging initialized using configuration in jar:file:/opt/module/apache-hive-3.1.3-bin/lib/hive-common-3.1.3.jar!/hive-log4j2.properties Async: true
sel^H^HHive-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 = 6485836a-bc38-4c85-a437-75ccf8608d79
hive> select * from stu;
OK
1	ss
1	ss
2	0421
3	0421-1
Time taken: 1.442 seconds, Fetched: 4 row(s)
hive> quit;
[2]+  已杀死               nohup hive --service metastore
[atguigu@hadoop102 conf]$ 


  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
目标检测(Object Detection)是计算机视觉领域的一个核心问题,其主要任务是找出图像所有感兴趣的目标(物体),并确定它们的类别和位置。以下是对目标检测的详细阐述: 一、基本概念 目标检测的任务是解决“在哪里?是什么?”的问题,即定位出图像目标的位置并识别出目标的类别。由于各类物体具有不同的外观、形状和姿态,加上成像时光照、遮挡等因素的干扰,目标检测一直是计算机视觉领域最具挑战性的任务之一。 二、核心问题 目标检测涉及以下几个核心问题: 分类问题:判断图像的目标属于哪个类别。 定位问题:确定目标在图像的具体位置。 大小问题:目标可能具有不同的大小。 形状问题:目标可能具有不同的形状。 三、算法分类 基于深度学习的目标检测算法主要分为两大类: Two-stage算法:先进行区域生成(Region Proposal),生成有可能包含待检物体的预选框(Region Proposal),再通过卷积神经网络进行样本分类。常见的Two-stage算法包括R-CNN、Fast R-CNN、Faster R-CNN等。 One-stage算法:不用生成区域提议,直接在网络提取特征来预测物体分类和位置。常见的One-stage算法包括YOLO系列(YOLOv1、YOLOv2、YOLOv3、YOLOv4、YOLOv5等)、SSD和RetinaNet等。 四、算法原理 以YOLO系列为例,YOLO将目标检测视为回归问题,将输入图像一次性划分为多个区域,直接在输出层预测边界框和类别概率。YOLO采用卷积网络来提取特征,使用全连接层来得到预测值。其网络结构通常包含多个卷积层和全连接层,通过卷积层提取图像特征,通过全连接层输出预测结果。 五、应用领域 目标检测技术已经广泛应用于各个领域,为人们的生活带来了极大的便利。以下是一些主要的应用领域: 安全监控:在商场、银行
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值