Hive工具的配置与使用

hive(一)hive的安装与基本配置 一、前提: 安装hive所需要的虚拟机环境为虚拟机安装有Hadoop并且集群成功,同时Hadoop需要在启动状态下,同时需要安装有mysql。不需要有zookeeper和HA,由于HA中含有大量进程,启动会占用很多资源,建议不要有HA 二、安装步骤: 1、上传jar包至/usr/local/soft 将hive-3.1.2上传到虚拟机中的/usr/local/soft目录下 2、解压并重命名 tar -zxvf apache-hive-3.1.2-bin.tar.gz # 重命名 mv ap 阅读详情
Hive有三种模式:
  • 内嵌Derby方式
  • Local方式
  • Remote方式
在实际的开发中,我们经常用的是第三种,所以接下来我们就介绍一下Remote方式的Hive如何配置

由于Remote方式和Local方式都是使用的mysql数据库,所以在安装Hive之前,我们需要先安装mysql

  1. 首先从官网下载安装文件 http://mirror.bit.edu.cn/apache/hive/

  2. 然后把文件上传到Linux中,解压并重命名为hive-1.2.1,由于Remote方式中是多用户操作,所以分为服务器端的配置和客户端的配置。

  3. 我们先来配置服务器端,在hive-1.2.1下的conf目录,有一个hive-default.xml.template文件,把它重命名为hive-site.xml

  4. 接下来在hive-site.xml中配置hive

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>  

<configuration>  
<property>  
  <name>hive.metastore.warehouse.dir</name>  
  <value>/user/hive_remote/warehouse</value>  
</property>  
   
<property>  
  <name>hive.metastore.local</name>  
  <value>true</value>  
</property>  
   
<property>  
  <name>javax.jdo.option.ConnectionURL</name>  //此处是指定hive在mysql中的连接的是hive_meta数据库
  <value>jdbc:mysql://localhost/hive_meta?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>  //此处是指定hive连接mysql时使用的用户名
</property>  
   
<property>  
  <name>javax.jdo.option.ConnectionPassword</name>  
  <value>123</value>  //此处是指定hive连接mysql时使用的密码
</property>  
</configuration>  
  1. 接下来是client端的配置,可以把Server端解压好的安装包直接拿过来,也可以重新解压,同样在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>  
   
<property>  
  <name>hive.metastore.local</name>  
  <value>false</value>  
</property>  
  
<property>  
  <name>hive.metastore.uris</name>  
  <value>thrift://XXX.XXX.XX.XXX:9083</value>  //此处配置的是Server的ip,端口号默认都是9083
</property>  
 
</configuration>  
  1. 到这里,Hive的配置基本就完成了,需要注意的是,在启动过程中如果Hadoop安装目录下的$HADOOP_HOME/share/hadoop/yarn/lib下的jline-2.12.jar的版本和Hive的lib目录下的jline版本不一致,所以启动的时候会报错,这时候需要将Hive中的jline-2.12.jar拷贝到Hadoop的share/hadoop/yarn/lib目录下,再次启动正常。
    在这里插入图片描述

  2. 接下来就是正常启动,由于在配置文件中我们配置了hive连接的数据库为hive_meta,用户为hive,密码为123,所以需要先在mysql数据库中创建hive_meta表,创建hive用户并授权hive用户相关权限grant all privileges on hive_meta.* to hive@"%" identified by '123'; 然后可以在Server端启动一下hive,直接输入hive即可,在这里插入图片描述

  3. 如果Server端可以正常启动如果Server端可以正常启动,就可以输入hive --service metastore命令,启动远程连接进程。

  4. 在客户端直接使用hive命令即可连接正常使用。

Hive Beeline

  1. 修改服务器端hive-site.xml文件,配置用户名和密码。
<property>
      <name>hive.server2.authentication</name>
      <value>CUSTOM</value>
</property>
<property>
       <name>hive.jdbc_passwd.auth.zhangsan</name>
       <value>123456789</value>
</property>
<property>
     <name>hive.server2.custom.authentication.class</name>
     <value>com.hoe.hive.authoriz.UserPasswdAuth</value>
</property>
  1. 在服务器端使用hiveserver2(hive的bin目录下)启动thirftserver
  2. 通过Beeline输入用户名密码连接
    在这里插入图片描述
  3. 通过JDBC连接
服务端启动hiveserver2后,在java代码中通过jdbc访问默认端口10000进行连接、访问
Hive的安装与配置——第1关:Hive的安装与配置 外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-ysxGddek-1666195111052)(D:\文件\大三上\大数据库\educoder_Hive的安装.png)]版本就说明安装成功,但是可以看到其中有一些警告信息,是由于包的冲突引起的。补充完代码后,点击测评,平台会对你编写的代码进行测试,当你的结果与预期输出一致时,即为通过。**注意:**通过本关后,请继续完成第二关,第二关是在。注意:安装过程中会提示设置密码什么的,不要忘了设置。到该目录下,并将解压的文件重命名为。 阅读详情

相关推荐

Hive on Spark配置

Hive on Spark安装,hadoop-3.3.0,spark-3.4.3-bin-hadoop3,apache-hive-3.1.3

ayong95的专栏 2905

【大数据】Hive可视化工具dbeaver

Hive可视化工具dbeaver 1、dbeaver基本介绍 dbeaver是一个图形化的界面工具,专门用于与各种数据库的集成,通过dbeaver我们可以与各种数据库进行集成通过图形化界面的方式来操作我们的数据库与数据库表,类似于我们的sqlyog或者navicat。 2、下载dbeaver 我们可以直接从github上面或者官网下载我们需要的对应的安装包即可 https://github.com/dbeaver/dbeaver/releases https://dbeaver.io/download/ 3

Chenftli的博客 2万+

Hive的安装及配置

集群规划:本虚拟机上有三台机器,主机名分别是hadoop102,103,104. 一:hive的安装部署 1.把apache-hive-1.2.1-bin.tar.gz上传到linux的/opt/software目录下(可根据自己目录来,下同) 2.解压apache-hive-1.2.1-bin.tar.gz到/opt/module/目录下面 tar -zxvf apache-hive-1.2.1-bin.tar.gz -C /opt/module/ 3.在mudule目录下修改apache-hive-1

mo 5142

使用可视化工具链接hive

DBeaver是一款免费、开源的数据库管理工具,支持多种关系型数据库,包括MySQL、PostgreSQL、Oracle、SQLite、Microsoft SQL Server,还可以链接hive。它是一款跨平台软件,支持Windows、macOS、Linux等操作系统。DBeaver提供了强大的数据库管理功能,包括数据库连接、SQL编辑器、数据导入导出、数据备份、数据恢复等。同时,它还支持多个数据库连接,可以在一个界面中同时管理多个数据库,方便用户进行跨数据库的操作和管理。

weixin_43322583的博客 1362

hive的安装与配置

hive的安装与配置详解 hive 中mysql的配置

weixin_47591848的博客 1727

Hive的安装与配置

Hive官网:http://hive.apache.org下载网址:http://archive.apache.org/dist/hive/文档网址:https://cwiki.apache.org/confluence/display/Hive/LanguageManual安装前提:3台虚拟机,安装了Hadoop安装软件:Hive(2.3.7) + MySQL (5.7.26)

m0_74470173的博客 1718

Hive可视化工具----DBeaver IDEA

将库中原有的驱动删除,将资料中的hive-jdbc-3.12的驱动添加进来.点击确定.DBeaver社区版,开源免费 这个软件不只可以连接hive还可以连接mysql.填写要连接的主机和用户名 ,密码可以不填,之后点击编辑驱动.idea,创建一个项目即可。

m0_53400772的博客 1056

Hive(番外):Hive可视化工具IntelliJ IDEA

Sublime、Emacs 、EditPlus、UltraEdit、Visual Studio Code等 有些不支持作为客户端连接Hive服务,但是支持SQL语法环境,那就再编辑器中开发SQL,复制到Hive CLI执行;IntelliJ IDEA、DataGrip、Dbeaver、SQuirrel SQL Client等。这类工具往往专门针对SQL类软件进行开发优化、页面美观大方,操作简洁,更重要的是SQL编辑环境优雅;SQL语法智能提示补全、关键字高亮、查询结果智能显示、按钮操作大于命令操作;

u013938578的博客 2255

3.Hive SQL数据定义语言(DDL)

Hive学习笔记3,自用

hutc_Alan的博客 1596

hive执行计划可视化工具

hive执行计划可视化工具

FPGA以太网开发实战:YT8511 PHY芯片MDIO接口配置全流程(附Verilog代码)

本文详细介绍了FPGA以太网开发中YT8511 PHY芯片MDIO接口的配置全流程,包括MDIO接口技术解析、Verilog状态机设计、核心代码实现细节及实战调试经验。通过提供经过验证的Verilog代码和优化策略,帮助开发者快速掌握以太网PHY芯片配置技术,提升通信系统性能。

weixin_29184371的博客 233

Hive安装与配置详解

评论- 6 Hive安装与配置详解 hive安装和配置 hive的测试 hive安装和配置 安装 一:下载hive——地址:http://mirror.bit.edu.cn/apache/hive/ 这里以hive-2.1.1为例子,如图: 将hive解压到/usr/local下: [root@s100 local]# tar -zxvf apache-hive-2.1.1-bin.tar.g...

weixin_43861175的博客 7万+

VOLTE信令流程-IMS注册篇(五)

目录 VOLTE信令流程-IMS 注册 VOLTE信令流程-IMS 注册/注销 VOLTE信令流程-VoLTE呼叫流程 VoLTE-VoLTE VoLTE-CS CS-VoLTE CS-CS VOLTE信令流程 VOLTE信令流程-VOLTE-VOLTE信令 VOLTE信令流程-INVITE详细信息 VOLTE信令流程-eSRVCC信令流程 VOLTE信令流程-IP短信 VOLTE信令流程-IMS 注册 IMS注册流程简述  获取鉴权向量 IMS用户将注...

gender123的博客 2万+

Hive的安装与配置详解

Hive的安装与配置详解

xx961782936的博客 5178

2024最新超详细无痛安装PyTorch,包括下载地址、环境配置与各种避坑指南

PyTorch更新很快,2024最新下载安装经验贴,包括anaconda+CUDA+cuDNN+PyTorch四部分的下载和安装。文章详细介绍了下载地址、环境配置、虚拟环境建立的问题,还温馨提示了各种闭坑指南。有需要的友友快过来康康!

qq_43596278的博客 11万+

解决屏幕不亮难题:慷智SerDes DE信号极性配置避坑指南

本文深入探讨了基于慷智AIM95x系列SerDes芯片的嵌入式显示系统开发中,因DE信号极性配置不匹配导致屏幕不亮的典型故障。文章详细解析了DE信号的核心作用与极性定义,提供了慷智SerDes芯片中DE极性寄存器的具体配置方法与调试记录,并给出了从隔离问题、对比时序到波形验证的系统性排查流程,帮助工程师快速定位并解决此类隐蔽问题。

weixin_29185493的博客 146

Hive配置

hive配置

qq_51180928的博客 1373

团结引擎+OpenHarmony 2实战篇:从零构建鸿蒙应用开发环境

本文详细介绍了如何从零开始构建鸿蒙应用开发环境,重点讲解了团结引擎与OpenHarmony 2的实战配置步骤。内容包括DevEco Studio安装、OpenHarmony SDK配置、团结引擎集成及项目创建等关键环节,帮助开发者快速搭建高效的开发环境,提升鸿蒙应用开发效率。

weixin_29294395的博客 265

Hive安装与配置

版本就说明安装成功,但是可以看到其中有一些警告信息,是由于包的冲突引起的。注意:安装过程中会提示设置密码什么的,不要忘了设置。安装完成之后可以使用如下命令来检查是否安装成功。分布式文件系统的数据仓库架构,主要运行在。通过上述命令检查之后,如果看到有。分布式环境下,因此,需要在文件。的内容,因此我们需要配置一下。运行时所需要的相关配置信息。完成后,在命令行模式(按。相关配置文件的路径,用于。已安装配置好的情况下。状态则表示安装成功。二进制包,下载好放在。我已经帮你下载好放在。

qq_58647543的博客 1241

从零开始创建Davinci Configurator配置工程

本文介绍了从零开始搭建达芬奇工程的详细步骤。首先安装Vector的CBD包后,通过DavicCFG.exe新建空白ECU工程。文章提到Postbuild相关概念可参考往期文章《AUTOSAR配置中的PostBuild、Precompile、Linktime》,并预告下期将讲解如何通过导入DBC文件来启用AUTOSAR模块。全文以实操截图为主,步骤清晰简明,适合开发者参考备份。

Xiaowestwind的博客 223

3、保险行业商业智能解决方案的理解与实施

本文详细探讨了商业智能(BI)在保险行业的应用与实施策略,涵盖了从BI环境开发的关键步骤、自下而上与自上而下的数据仓库开发方法,到决策支持工具的选择与使用。文章还分析了BI系统与互联网、内联网和外联网的结合方式,并讨论了购买与自建方案的优劣比较,最后总结了商业智能成功的关键因素及其对保险行业带来的商业价值。通过实际案例与未来趋势展望,展示了商业智能如何推动保险企业的数字化转型和竞争力提升。

moon9的博客 97

hive的配置

Hive安装的前提: -安装JDK 1.8.0_181 查看方法 window+r cmd 进入 输入命令 java -version -安装 Hadoop-2.4.1 查看方法 Hadoop里面输入命令 Hadoop version -安装MySQL 5.7.17 登录mysql即可看到版本信息 一安装: 1.下载hive最新稳定版本的包,并压缩到用户主目录下面 : tar -xzvf apache-hive-2.1.1-bin.tar.gz ...

weixin_57405721的博客 2583

芯片标称具备8kVESD能力却在8kV测试中失效?

芯片级ESD(HBM模型)与系统级ESD(IEC 61000-4-2)存在本质差异:

硬核科技 647

【hive】hive的安装配置,beeline使用(1)

hive的安装配置,beeline使用

hx1156477702的博客 2744

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: 基于高可用的HDFS分布式集群搭建Yarn
下一篇: Hive基础理论及表的类型
PowerBlogger
博客等级 码龄8年 10粉丝 17原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值