前言

本节讲metastore相关的知识.

hive所有的元数据都是通过matestore管理的.hive cli/hiveserver2包含了内置的metastore.

metastore参数

metastore的基本参数

K V 说明
javax.jdo.option.ConnectionURL jdbc连接字符串
javax.jdo.option.ConnectionDriverName jdbc驱动类名 当使用mysql时:com.mysql.jdbc.Driver
javax.jdo.option.ConnectionUserName 数据库连接用户名
javax.jdo.option.ConnectionPassword 数据库连接密码

metastore的额外参数

Configuration Parameter Description Default Value
org.jpox.autoCreateSchema 如果hive启动时没有相应的元数据Schecma,则创建相关的库\表等,安装之后装该参数设置为false.只在初始化时使用.一般不用这个功能都手动创建hive元数据
datanucleus.autoStartMechanism Whether to initialize on startup.
hive.metastore.server.min.threads Thrift server's pool最小连接数 200
hive.metastore.server.max.threads Thrift server's pool最大连接数 100000 since Hive 0.8.1
hive.metastore.filter.hook Metastore hook class for further filtering the metadata read results on client side.(Hive 1.1.0 and later.) org.apache.hadoop.hive.metastore.DefaultMetaStoreFilterHookImpl
hive.metastore.port Hive metastore listener port.(Hive 1.3.0 and later.) 9083

客户端参数

一切要使用metastore服务的客户端| K|V|说明|

K V 说明
hive.metastore.uris metastore服务器地址,用于客户端连接 可以配置多个
hive.metastore.warehouse.dir hive仓库在hdfs上的位置.这个应该不需要配置的

mestastore是没有状态的,因此可以启动多个metastore作为ha. client默认会选择hive.metastore.uris中的第一个,但第一个连接不上的话,则随机从列表中选一个.

使用zk自动发现mestastore

从hive4.0.0开始可以像hiveserver2一样通过zookeeper自动发现metastore实现ha.

Config Param Config Value Comment
hive.metastore.service.discovery.mode 默认不配置,可以是zookeeper 当设置为zookeeper时,metastore在启动实现会在zk中注册自己,在关闭时从zk取注销. server和client配置要相同
hive.metastore.uris zookeepr_host_name:port, host_name:port, ... 上面为zookeeper时,zookeepr集群地址.server和client配置要相同
hive.metastore.zookeeper.client.port port 上面要是设置了port这个就可以忽略.zookeeper服务器端口.server和client配置要相同
hive.metastore.zookeeper.namespace namespace name zookeeper中metastore的根目录
hive.metastore.zookeeper.session.timeout 单位毫秒 ZooKeeper client's session timeout. 心跳超过这个时间客户端与zk的连接断开
hive.metastore.zookeeper.connection.timeout 单位秒 ZooKeeper client's connection timeout in seconds. Connection timeout * hive.metastore.zookeeper.connection.max.retries with exponential backoff is when curator client deems connection is lost to zookeeper.
hive.metastore.zookeeper.connection.max.retries 连接zk的重试次数
hive.metastore.zookeeper.connection.basesleeptime 单位毫秒 Initial amount of time (in milliseconds) to wait between retries when connecting to the ZooKeeper server when using ExponentialBackoffRetry policy.

启动hive metastore服务

hive --service metastore [-p 9083]

9.Hive Metastore Administration的更多相关文章

  1. 【原创】大叔经验分享(24)hive metastore的几种部署方式

    hive及其他组件(比如spark.impala等)都会依赖hive metastore,依赖的配置文件位于hive-site.xml hive metastore重要配置 hive.metastor ...

  2. Hive安装配置指北(含Hive Metastore详解)

    个人主页: http://www.linbingdong.com 本文介绍Hive安装配置的整个过程,包括MySQL.Hive及Metastore的安装配置,并分析了Metastore三种配置方式的区 ...

  3. Hive metastore三种配置方式

    http://blog.csdn.net/reesun/article/details/8556078 Hive的meta数据支持以下三种存储方式,其中两种属于本地存储,一种为远端存储.远端存储比较适 ...

  4. Hadoop之Hive(2)--配置Hive Metastore

    Hive metastore服务以关系性数据库的方式存储Hive tables和partitions的metadata,并且提供给客户端访问这些数据的metastore service的API.下面介 ...

  5. Hive Metastore 代码简析

    1.  hive metastore 内部结构 1.1 包结构 从package结构来看,主要的5个package,让我们来看看这几个package的内容 (1) metastorepackage是m ...

  6. hive metastore异常 org.apache.thrift.protocol.TProtocolException: Missing version in readMessageBegin, old client

    hiveserver2的端口是10000hive.metastoe.uris 的端口9083改为10000之后 beelien 连接hiveserver2报错 Error: Could not ope ...

  7. Hive Metastore ObjectStore PersistenceManager自动关闭bug解析

    最近在测试HCatalog,由于Hcatalog本身就是一个独立JAR包,虽然它也可以运行service,但是其实这个service就是metastore thrift server,我们在写基于Hc ...

  8. hive metastore Server 出现异常

    报错信息: 常见问题分析: 1 hive metastore 数据库中用户名或者密码出现更改,并且重启了hive,导致生效但是CDH下没有及时更改hive metastore设置密码 2 Mysql ...

  9. Hive metastore整体代码分析及详解

    从上一篇对Hive metastore表结构的简要分析中,我再根据数据设计的实体对象,再进行整个代码结构的总结.那么我们先打开metadata的目录,其目录结构: 可以看到,整个hivemeta的目录 ...

随机推荐

  1. linux 缓存手动清除

    linux下怎么清理缓存 free -m 命令可以查看内存使用情况                   sysctl 命令可以临时改变某个系统参数  如:sysctl -w net.ipv4.ip_f ...

  2. smtp发送html报告与日志附件图片png

    1.非ssl发送: 授权码机制,开启smtp,获取授权码以qq邮箱为例: 附件展示: #!/usr/bin/python3 import os import smtplib from email.mi ...

  3. 小白第一次使用Git随笔

    想研究Git很久了,一直没有找到很好的博客或论坛,近几天工作项目任务没有那么重,就想着找几篇文章把这玩意儿给解决掉,本博客是记录读廖雪峰老师所写的<Git教程>的随笔,以便巩固学习,若想学 ...

  4. RHEL 7.6 安装 Oracle 18c RAC

    RHEL 7.6 安装 Oracle 18c RAC 第一部分 安装规划 虚拟环境 VirtualBox 6.0 OS 版本 Red Hat Enterprise Linux Server relea ...

  5. Linux学习笔记(第九章)

    压缩概念: gzip和zcat: 先进版bzip2,bzcat bzip -d  已压缩文档名 bzip -z 需压缩文档名 bzcat 解压文档打印到屏幕 tar:打包指令 注意:压缩最好拿掉根目录 ...

  6. NULLIF与ISNULL的交叉使用

    事件源于字词字段拼接,由于不清楚NULLIF的本质导致惨剧发生. ', 'T5')), '6063-T5') ', 'T5'), ''), '6063-T5') 函数f_CTRL_GetAlloy功能 ...

  7. 2017-2018-1 20155231 课堂测试 (ch06)

    2017-2018-1 20155231 课堂测试 (ch06) 1 (单选题|1分) 下面代码中,对数组x填充后,采用直接映射高速缓存,所有对x和y引用的命中率为(D) A .1 B .1/4 C ...

  8. 第五周加分题--mybash的实现

    第五周加分题--mybash的实现 题目要求 1.使用fork,exec,wait实现mybash 2.写出伪代码,产品代码和测试代码 3.发表知识理解,实现过程和问题解决的博客(包含代码托管链接) ...

  9. 远端访问MySQL

    磨砺技术珠矶,践行数据之道,追求卓越价值 回到上一级页面: PostgreSQL杂记页     回到顶级页面:PostgreSQL索引页 [作者 高健@博客园  luckyjackgao@gmail. ...

  10. 基于Keras的imdb数据集电影评论情感二分类

    IMDB数据集下载速度慢,可以在我的repo库中找到下载,下载后放到~/.keras/datasets/目录下,即可正常运行.)中找到下载,下载后放到~/.keras/datasets/目录下,即可正 ...