用于现有Hadoop实例的HIVE Docker容器

时间:2019-05-02 15:09:25

标签: docker hadoop hive docker-compose

我有2个用于Hadoop HDFS的工作容器(我从一个here开始为它们构建了一个Dockerfile),并且需要向该集中添加一个HIVE实例。

我找不到可以使用的有效图像(拥有2.3.4版会很好)。

您有什么值得推荐的,易于添加的内容吗?

谢谢!

修改

这是我尝试过的尝试:

hive-server:
        container_name:   hive-server
        image:            bde2020/hive:2.3.2-postgresql-metastore
        depends_on:
            - hadoop-namenode
        env_file:
              - ./hive_build/hadoop-hive.env
        environment:
            HIVE_CORE_CONF_javax_jdo_option_ConnectionURL: "jdbc:postgresql://hive-metastore/metastore"
            SERVICE_PRECONDITION: "hive-metastore:9083"
        ports:
            - "10000:10000"
        restart:          unless-stopped

hive-metastore:
    container_name:   hive-metastore
    image:            bde2020/hive:2.3.2-postgresql-metastore
    depends_on:
        - hive-server
        - hive-metastore-postgresql
    env_file:
        - ./hive_build/hadoop-hive.env
    command:          /opt/hive/bin/hive --service metastore
    environment:
        SERVICE_PRECONDITION: "hadoop-namenode:50070 hadoop-datanode1:50075 hive-metastore-postgresql:5432"
    ports:
        - "9083:9083"
    restart:          unless-stopped

hive-metastore-postgresql:
    container_name:   hive-metastore-postgresql
    image:            bde2020/hive-metastore-postgresql:2.3.0
    ports:
        - "5433:5432"
    restart:          unless-stopped

但是当我输入它并尝试连接时,我得到一个错误:

docker exec -it hive-server bash

/opt/hive/bin/beeline -u jdbc:hive2://localhost:10000

错误:

19/05/03 09:13:46 [main]: WARN jdbc.HiveConnection: Failed to connect to localhost:10000
Could not open connection to the HS2 server. Please check the server URI and if the URI is correct, then ask the administrator to check the server status.
Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: java.net.ConnectException: Connection refused (Connection refused) (state=08S01,code=0)

0 个答案:

没有答案