hive metadata 容器镜像

hive 3.0 之后metadata 是可以支持独立部署的,可以方便开源社区好多工具支持使用
以下是一个参考的docker镜像以及运行

参考使用

 
version: "3"
services:
  mariadb:
    image: mariadb:10
    container_name: mariadb
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: admin
      MYSQL_USER: admin
      MYSQL_PASSWORD: admin
      MYSQL_DATABASE: metastore_db
  hive-metastore:
    image: dalongrong/hive-metastore:3.2.0
    depends_on:
      - mariadb
    ports:
      - 9083:9083
    environment:
      - DB_URI=mariadb:3306
    volumes:
      - ./etc/hive-site.xml:/opt/apache-hive-bin/conf/hive-site.xml

hive-site.xml 实际集合场景修改

<configuration>
    <property>
        <name>hive.metastore.uris</name>
        <value>thrift://hive:9083</value>
        <description>Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.</description>
    </property>
    <property>
        <name>hive.metastore.event.db.notification.api.auth</name>
        <value>false</value>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionDriverName</name>
        <value>com.mysql.jdbc.Driver</value>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionURL</name>
        <value>jdbc:mysql://mariadb:3306/metastore_db</value>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionUserName</name>
        <value>admin</value>
    </property>
    <property>
        <name>javax.jdo.option.ConnectionPassword</name>
        <value>admin</value>
    </property>
    <property>
        <name>hive.metastore.schema.verification</name>
        <value>false</value>
    </property>
    <property>
        <name>fs.s3a.path.style.access</name>
        <value>true</value>
    </property>
    <property>
        <name>fs.s3.impl</name>
        <value>org.apache.hadoop.fs.s3a.S3AFileSystem</value>
    </property>
    <property>
        <name>fs.s3a.impl</name>
        <value>org.apache.hadoop.fs.s3a.S3AFileSystem</value>
    </property>
    <property>
        <name>fs.s3a.endpoint</name>
        <value>http://lakefs:8000</value>
    </property>
    <property>
        <name>fs.s3a.access.key</name>
        <value>AKIAIOSFODNN7EXAMPLE</value>
    </property>
    <property>
        <name>fs.s3a.secret.key</name>
        <value>wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</value>
    </property>
</configuration>

说明

以上镜像来自lakefs test 实例,自己构建了一个并发布到dockerhub 方便使用

参考资料

https://github.com/treeverse/lakeFS/tree/master/test/lakectl_metastore
https://cwiki.apache.org/confluence/display/Hive/AdminManual+Metastore+3.0+Administration
https://hub.docker.com/repository/docker/dalongrong/hive-metastore

posted on 2022-02-12 23:07  荣锋亮  阅读(218)  评论(0编辑  收藏  举报

导航