hetu-core/hetu-docs/zh/admin/meta-store.md

2.1 KiB
Raw Permalink Blame History

元数据存储

本节介绍openLooKeng元数据存储。元数据存储用于存储元数据信息, 当前元数据存储支持将元数据保存在RDBMS或HDFS中。

配置元数据存储

首先在etc目录下创建配置文件hetu-metastore.properties

使用RDBMS存储

在配置文件hetu-metastore.properties增加如下配置:

hetu.metastore.type=jdbc
hetu.metastore.db.url=jdbc:mysql://....
hetu.metastore.db.user=root
hetu.metastore.db.password=123456
hetu.metastore.cache.type=local

上述属性说明如下:

  • hetu.metastore.type元数据存储类型使用RDBMS存储时配置为jdbc
  • hetu.metastore.db.url连接RDBMS的URL。
  • hetu.metastore.db.user :连接RDBMS的用户名。
  • hetu.metastore.db.password :连接RDBMS的密码。
  • hetu.metastore.cache.type :选择缓存模型,其中local为本地缓存,global为分布式缓存。

使用HDFS存储

在配置文件hetu-metastore.properties增加如下配置:

hetu.metastore.type=hetufilesystem
hetu.metastore.hetufilesystem.profile-name=hdfs-config-metastore
hetu.metastore.hetufilesystem.path=/etc/openlookeng/metastore

上述属性说明如下:

  • hetu.metastore.type元数据存储类型使用HDFS存储时配置为hetufilesystem
  • hetu.metastore.hetufilesystem.profile-name使用HDFS存储配置文件的名称。
  • hetu.metastore.hetufilesystem.path:配置文件的路径。

可以从文件系统中获取更多的文件系统相关的信息

元数据存储缓存

openLooKeng可以配置开启元数据缓存开启后访问元数据时会将其缓存到内存中再次访问时可以提高元数据访问效率。 在配置文件hetu-metastore.properties增加如下配置:

hetu.metastore.cache.size=10000
hetu.metastore.cache.ttl=4h     

上述属性说明如下:

  • hetu.metastore.cache.size元数据缓存大小默认10000。
  • hetu.metastore.cache.ttl缓存元数据的过期时间默认值4h (0表示元数据缓存关闭)。