前言

本节讲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. ubuntu16.04常见的问题解决方案

    问题一:关于咖啡主机和其他服务器厂商和个人虚拟机VM10安装ubuntu16.04 ubuntu16.04默认是没有root用户的,要想有必须要通过用户创建,通常安装ubuntu16.04会有个让你创 ...

  2. TensorFlow安装-Windows

    参考:https://blog.csdn.net/dou3516/article/details/77836459 一.安装环境 TensorFlow即可以支持CPU,也可以支持CPU+GPU.前者的 ...

  3. 1550: Simple String (做得少的思维题,两个字符串能否组成另外一个字符串问题)

    1550: Simple String Submit Page    Summary    Time Limit: 1 Sec     Memory Limit: 256 Mb     Submitt ...

  4. CSU 2056 a simple game (正反进行KMP)超级好题!!!

    Description 这一天,小A和小B在玩一个游戏,他俩每人都有一个整数,然后两人轮流对他们的整数进行操作,每次在下列两个操作任选一个: (1)对整数进行翻转,如1234翻转成4321 ,1200 ...

  5. Animate.css介绍

    Animate.css简介 animate.css 动画库,预设了抖动(shake).闪烁(flash).弹跳(bounce).翻转(flip).旋转(rotateIn/rotateOut).淡入淡出 ...

  6. easyui div 上下布局 最大化按钮 隐藏标题

    背景:easyui在做上下布局的时候,上面是数据列表,下面是数据图表.如下图 需要在上下面板右上角加上最大化按钮,以便可以全屏显示.逻辑就是当上面点击最大化时候,隐藏下面,主意:此时需要将下面的div ...

  7. hadoop日常维护之问题解决01

    执行hadoop任务遇到的问题: Caused by: org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /user/h ...

  8. mysql——leetcode问题记录

    问题: 表1: Person +-------------+---------+ | 列名 | 类型 | +-------------+---------+ | PersonId | int | | ...

  9. Scala 方法和函数

    package com.bigdata // /** Scala 方法和函数:Scala中既有函数也有方法,大多数情况下我们都可以不去理会他们之间的区别. * * 方法:Scala 中的方法跟 Jav ...

  10. 学习scalaenv

    背景 最近由于工作需要, 我总是在不同的scala项目间流动开发. 这就遇到一个很棘手的问题, 这几个项目用的scala版本不一致, 老项目用的是 scala 2.11.8, 新项目用的是 scala ...