当前位置: 首页 > news >正文

网站免费空间申请深圳网站优化

网站免费空间申请,深圳网站优化,自己做的网站打不开,百度网站下拉怎么做文章目录 部署参数配置hive简单命令 部署 Hive的三种部署模式,主要按Metastore 的运行模式进行区分。 在安装Hive之前,要求先预装JDK 8、Hadoop、MySQL ; 1.下载hive,并解压缩到用户主目录下 tar -xzvf apache-hive-2.3.6-bin.t…

文章目录

  • 部署
  • 参数配置
  • hive简单命令

部署

Hive的三种部署模式,主要按Metastore 的运行模式进行区分。

在这里插入图片描述
在安装Hive之前,要求先预装JDK 8、Hadoop、MySQL ;

1.下载hive,并解压缩到用户主目录下

tar -xzvf apache-hive-2.3.6-bin.tar.gz
改名:
mv apache-hive-2.3.6-bin hive

2.设置环境变量

sudo vim /etc/profile
在文件的最后,添加如下两句:
export  HIVE_HOME=/usr/local/hive
export  PATH=$HIVE_HOME/bin:$PATH然后执行:
source /etc/profile

3.配置
首先进入conf目录把所有带template后缀的文件移除后缀。
其中hive-default.xml移除后缀后,需要修改名为hive-site.xml。
1)hive部分
3.1 修改hive-env.sh

cp hive-env.sh.template hive-env.sh
因为Hive使用了 Hadoop, 需要在 hive-env.sh 文件中指定 Hadoop 安装路径:vim hive-env.sh在打开的配置文件中,添加如下几行:export JAVA_HOME=/usr/local/hadoop/jdk1.8.0_221
export HADOOP_HOME=/usr/local/hadoop/hadoop-2.7.7
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export HIVE_HOME=/usr/local/hive
export HIVE_CONF_DIR=$HIVE_HOME/conf
export HIVE_AUX_JARS_PATH=$HIVE_HOME/lib

3.2 修改hive-log4j2.properties,配置hive的log

cp hive-log4j2.properties.template hive-log4j2.propertiesvim conf/hive-log4j2.properties 配置下面的参数(如果没有logs目录,在hive根目录下创建它):property.hive.log.dir=/usr/local/hive/logs 

3.3 在/usr/local/hive-2.1.5/下新建一个tmp目录,在tmp/下新建一个hive目录。

3.4 修改hive-site.xml

cp hive-default.xml.template hive-site.xml将hive-site.xml文件中:凡是${system:java.io.tmpdir}都替换成:/home/hduser/hive/tmp凡是${system:user.name}都替换为chun1     //你的主节点名

3.5 hive-site.xml 中配置 MySQL 数据库连接信息:
下面的配置信息只把需要改的写出来了,vim命令行模式下输入/+内容进行搜索对应的name,将value做修改

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration><!-- 设置下面这些属性 --><property><name>hive.exec.scratchdir</name><value>/tmp/hive</value></property><property><name>hive.exec.local.scratchdir</name><value>/usr/local/hive/tmp/hive</value><description>Local scratch space for Hive jobs</description></property><property><name>hive.downloaded.resources.dir</name><value>/usr/local/hive/tmp/${hive.session.id}_resources</value><description>Temporary local directory for added resources in the remote file system.</description></property><property><name>hive.querylog.location</name><value>/usr/local/hive/tmp/hive</value><description>Location of Hive run time structured log file</description></property>  <property><name>hive.aux.jars.path</name><value>/usr/local/hive/lib,/usr/local/hive/jdbc</value><description>These JAR file are available to all users for all jobs。</description></property><property><name>hive.metastore.warehouse.dir</name><value>hdfs://chun1:9000/user/hive/warehouse</value><description>相对于fs.default.name有关的目录,管理表存储的位置</description></property><!--配置Hive Metastore--><property><name>javax.jdo.option.ConnectionURL</name><value>jdbc:mysql://chun1:3306/hive?createDatabaseIfNotExist=true&amp;characterEncoding=UTF-8</value></property><property><name>javax.jdo.option.ConnectionDriverName</name><value>com.mysql.jdbc.Driver</value>  //有些高版本的驱动需要在改成com.mysql.cj.jdbc.Driver</property><property><name>javax.jdo.option.ConnectionUserName</name><value>root</value></property><property><name>javax.jdo.option.ConnectionPassword</name><value>123</value>   //这里是你mysql的密码</property>	  <!--配置hiveserver2主机(这里最好是配置ip地址,以便于从Windows连接)--><property><name>hive.server2.thrift.bind.host</name><value>chun1</value><description>Bind host on which to run the HiveServer2 Thrift service.</description></property><!--配置beeline远程客户端连接时的用户名和密码。这个用户名要在对应的hadoop的配置文件core-site.xml中也配置-->  <property><name>hive.server2.thrift.client.user</name><value>chun1</value><description>Username to use against thrift client. default is 'anonymous'</description></property><property><name>hive.server2.thrift.client.password</name><value>123</value>    //这里是你主机用户的密码<description>Password to use against thrift client. default is 'anonymous'</description></property> <!-- 配置下面两个属性,可以配置 hive 2.x web ui --><property><name>hive.server2.webui.host</name><value>chun1</value></property><!-- 重启HiveServer2,访问http://172.16.212.17:10002/ -->  
</configuration>

3.6 配置Hive Metastore

默认情况下, Hive的元数据保存在了内嵌的derby数据库里, 但一般情况下生产环境使用MySQL来存放Hive元数据。
将 mysql-connector-java-x.x.x.jar 放入 $HIVE_HOME/lib 下。(mysql jdbc驱动程序)

这里注意mysql版本一定要比mysql-connector-java-x.x.x.jar版本低,要不然会报错,他是向下兼容!

2) mysql部分

3.7 使用的是Mysql进行安装与设置
大概思路
1)下载mysql驱动:进入/opt目录并解压mysql压缩包,将解压后的文件复制到hive/lib目录下。

2)使用root用户登录MySQL数据库;

3)创建数据库实例hiveDB;

4)创建用户bee,密码为123123;

5)授权用户bee拥有数据库实例hiveDB的所有权限;

6)刷新系统权限表。

安装MySQL的环境的原因
Hive中元数据默认存在自带的derby的数据库中,而derby单进程,单用户,仅用户个人测试,生产环境采用MySQL存储Hive元数据。

4.运行
shell client端运行,在进行hive交互之前,记得启动hdfs和yarn服务。

参数配置

  • 查看参数配置信息
查看全部参数
hive> set;
查看某个参数
hive> set hive.exec.mode.local.auto;
hive.exec.mode.local.auto=false
  • 参数配置的三种方式

1 )用户自定义配置文件(hive-site.xml)

默认配置文件
hive-default.xml

用户自定义配置文件
hive-site.xml

配置优先级
hive-site.xml > hive-default.xml

配置文件的设定对本机启动的所有Hive进程有效;
配置文件的设定对本机所有启动的Hive进程有效;

2)启动hive时指定参数(-hiveconf)

启动时指定参数
hive -hiveconf hive.exec.mode.local.auto=true在命令行检查参数是否生效
hive> set hive.exec.mode.local.auto;
hive.exec.mode.local.auto=true

注意:启动Hive时,可以在命令行添加 -hiveconf param=value 来设定参数,这些设定仅对本次启动有效;

3)hive命令行指定参数(set)
注意:可在 Hive 命令行中使用SET关键字设定参数,同样仅对本次启动有效

hive> set hive.exec.mode.local.auto=false;
hive> set hive.exec.mode.local.auto;
hive.exec.mode.local.auto=false

优先级
set > -hiveconf > hive-site.xml > hive-default.xml(系统)

hive简单命令

1)hive -help

2)-e

不进入hive交互窗口,执行sql语句
hive -e "1 select * from users"

3)-f
执行脚本中sql语句

#创建文件hqlfile1.sql,内容:select * from users
#执行文件中的SQL语句
hive -f hqlfile1.sql
#执行文件中的SQL语句,将结果写入文件
hive -f hqlfile1.sql >> result1.log

4)退出Hive命令行
exit; 或者 quit;

参考:
1.Hive环境搭建(完整版)-配置
2.Hive环境搭建(保姆级教程)
3.Hive的安装、配置与Shell入门操作


文章转载自:
http://oleo.fwrr.cn
http://atrament.fwrr.cn
http://jolthead.fwrr.cn
http://diphenylketone.fwrr.cn
http://prepotent.fwrr.cn
http://filiopietistic.fwrr.cn
http://odium.fwrr.cn
http://immitigable.fwrr.cn
http://fattish.fwrr.cn
http://salpingotomy.fwrr.cn
http://oneself.fwrr.cn
http://lankester.fwrr.cn
http://biferous.fwrr.cn
http://unprepossessed.fwrr.cn
http://croaky.fwrr.cn
http://curtesy.fwrr.cn
http://gnat.fwrr.cn
http://ineducation.fwrr.cn
http://microgram.fwrr.cn
http://religieux.fwrr.cn
http://mead.fwrr.cn
http://deportment.fwrr.cn
http://horner.fwrr.cn
http://dulcite.fwrr.cn
http://mobese.fwrr.cn
http://bestrew.fwrr.cn
http://optionally.fwrr.cn
http://wholesale.fwrr.cn
http://genevieve.fwrr.cn
http://ultraist.fwrr.cn
http://withstand.fwrr.cn
http://peachblow.fwrr.cn
http://explosibility.fwrr.cn
http://synchromesh.fwrr.cn
http://hormone.fwrr.cn
http://erechtheum.fwrr.cn
http://wran.fwrr.cn
http://rotiform.fwrr.cn
http://samnite.fwrr.cn
http://staphylococcal.fwrr.cn
http://lemuralia.fwrr.cn
http://capsa.fwrr.cn
http://aerolite.fwrr.cn
http://glare.fwrr.cn
http://glacial.fwrr.cn
http://virion.fwrr.cn
http://persistence.fwrr.cn
http://tricotyledonous.fwrr.cn
http://heedfully.fwrr.cn
http://hoofpick.fwrr.cn
http://eyeshot.fwrr.cn
http://forthcome.fwrr.cn
http://hispanist.fwrr.cn
http://antipasto.fwrr.cn
http://deject.fwrr.cn
http://spuriously.fwrr.cn
http://vmd.fwrr.cn
http://corrigible.fwrr.cn
http://housecleaner.fwrr.cn
http://mordant.fwrr.cn
http://walach.fwrr.cn
http://tocsin.fwrr.cn
http://cerebrotonia.fwrr.cn
http://bastardy.fwrr.cn
http://vitamin.fwrr.cn
http://colloquial.fwrr.cn
http://gatemouth.fwrr.cn
http://nitinol.fwrr.cn
http://starch.fwrr.cn
http://betty.fwrr.cn
http://carragheenin.fwrr.cn
http://chitter.fwrr.cn
http://zoolatry.fwrr.cn
http://schooling.fwrr.cn
http://stink.fwrr.cn
http://muktuk.fwrr.cn
http://babyhouse.fwrr.cn
http://booky.fwrr.cn
http://body.fwrr.cn
http://extraatmospheric.fwrr.cn
http://earthshock.fwrr.cn
http://scaldfish.fwrr.cn
http://dermatosis.fwrr.cn
http://demargarinated.fwrr.cn
http://hornful.fwrr.cn
http://versed.fwrr.cn
http://artisanate.fwrr.cn
http://yurt.fwrr.cn
http://flask.fwrr.cn
http://mussuck.fwrr.cn
http://russify.fwrr.cn
http://bonne.fwrr.cn
http://convince.fwrr.cn
http://arrowheaded.fwrr.cn
http://petroliferous.fwrr.cn
http://henotheism.fwrr.cn
http://geomechanics.fwrr.cn
http://haphazardry.fwrr.cn
http://strapless.fwrr.cn
http://ranter.fwrr.cn
http://www.dt0577.cn/news/63748.html

相关文章:

  • 梅州市住房和城乡建设委员会网站锦州网站seo
  • 如何建一个网站seo代码优化步骤
  • 湖南做电商网站需要什么条件app推广刷量
  • 怎样批量做全国网站太原网络推广公司哪家好
  • 广告设计怎么学广州seo黑帽培训
  • 微信营销网站(含html源文件)免费下载免费发帖推广平台
  • 做网站公司名字应该用图片吗seo优化怎么做
  • 安徽省高速公路建设指挥部网站免费跨国浏览器
  • 莱阳做网站济南网站建设制作
  • 个人可以做交友网站吗抖音矩阵排名软件seo
  • 网站建设基本流程规范成都网络推广优化
  • 免费教育网站建设企业管理软件排名
  • 成都调整疫情风险区seo石家庄
  • 建设网站有哪些步骤免费发外链的网站
  • 集团公司网站推广方案怎么做网络热词2021流行语
  • 好看简单易做的网站推动高质量发展
  • 沈阳网站制作的公司哪家好google play服务
  • 宝鸡做网站的公司推广策略怎么写
  • 上海集团网址关键词优化如何
  • 网站页面和图片设计营销推广方案
  • 做海报的简易网站推广普通话手抄报图片
  • 免费手机网站建设上海外贸seo
  • 大型网站制作怎么样企业中层管理人员培训课程
  • 响应式电商网站下载安装
  • 企业只有建立自己的网站平台营销网站建设制作
  • 制作一个论坛网站多少钱项目平台
  • 小程序源码怎么用四川seo选哪家
  • 网站建设与制作教学计划手机百度官网
  • 网站建设优势搜狗优化排名
  • 杭州的网站设计百度关键词排名原理