postgresql Hive Metastore容器从未启动

yzxexxkh  于 2023-08-04  发布在  PostgreSQL
关注(0)|答案(1)|浏览(127)

我正在构建一个涉及minio的docker-compose项目,以及一个带有Postgres后端的hive metastore,我的compose文件看起来像这样:

services:
  minio:
    image: minio/minio:latest
    ports:
      - "9000:9000"
      - "9001:9001"
    volumes:
      - ./minio-data:/data
    environment:
      MINIO_ACCESS_KEY: test
      MINIO_SECRET_KEY: test12334567
    command: server /data --console-address ":9001"

  createbuckets:
    image: minio/mc
    depends_on:
      - minio
    entrypoint: >
      /bin/sh -c "
      sleep 60;
      /usr/bin/mc config host add myminio http://minio:9000 test test12334567;
      /usr/bin/mc mb myminio/sample-lakehouse;
      exit 0;
      "
  
  hive_metastore:
    image: starburstdata/hive:3.1.2-e.18
    hostname: hive_metastore
    ports: 
      - "9083:9083"
    environment: 
      HIVE_METASTORE_DRIVER: org.postgresql.Driver 
      HIVE_METASTORE_JDBC_URL: jdbc:postgresql:/metastore_database:5432/metastore 
      HIVE_METASTORE_USER: hiveuser
      HIVE_METASTORE_PASSWORD: hivepw
      HIVE_METASTORE_WAREHOUSE_DIR: s3://sample-lakehouse/
      S3_ENDPOINT: http://minio:9000
      S3_ACCESS_KEY: test
      S3_SECRET_KEY: test12334567
      S3_PATH_STYLE_ACCESS: "true"
      S3_ENDPOINT_SSL_ENABLED: "false"
      HIVE_METASTORE_USERS_IN_ADMIN_ROLE: "admin"
    depends_on:
      - metastore_database
      - minio 
  
  metastore_database:
    image: postgres:15
    hostname: metastore_database
    environment:
      POSTGRES_USER: hiveuser 
      POSTGRES_PASSWORD: hivepw 
      POSTGRES_DB: metastore

字符串
当我启动这些服务时,它们都存在于Hive元存储区之外。当我打印该容器的日志时,我得到以下内容:

++ dirname /opt/bin/start-hive-metastore.sh
+ cd /opt/bin
+ SERVICE=metastore
+ getopts :hs: opt
+ test -v HIVE_METASTORE_JDBC_URL
+ test -v HIVE_METASTORE_DRIVER
+ test -v HIVE_METASTORE_USER
+ test -v HIVE_METASTORE_PASSWORD
+ test -v S3_ENDPOINT
+ test -v S3_ACCESS_KEY
+ test -v S3_SECRET_KEY
+ test -v S3_PATH_STYLE_ACCESS
+ test -v REGION


Postgres数据库中的数据库和用户存在,我已经检查过了。我还用

sleep 600


命令执行到它,设置env变量并运行启动脚本,但在控制台中得到相同的输出。在合成文件环境部分的“”中设置环境变量也不起作用。
有谁知道为什么集装箱会立即退出?

6ie5vjzr

6ie5vjzr1#

您需要指定所有的环境变量,即使它们为null,例如

REGION: ""
GOOGLE_CLOUD_KEY_FILE_PATH: ""
AZURE_ADL_CLIENT_ID: ""
AZURE_ADL_CREDENTIAL: ""
AZURE_ADL_REFRESH_URL: ""
AZURE_ABFS_STORAGE_ACCOUNT: ""
AZURE_ABFS_ACCESS_KEY: ""
AZURE_WASB_STORAGE_ACCOUNT: ""
AZURE_ABFS_OAUTH: ""
AZURE_ABFS_OAUTH_TOKEN_PROVIDER: ""
AZURE_ABFS_OAUTH_CLIENT_ID: ""
AZURE_ABFS_OAUTH_SECRET: ""
AZURE_ABFS_OAUTH_ENDPOINT: ""
AZURE_WASB_ACCESS_KEY: ""

字符串

相关问题