| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| version: '3.9' |
| services: |
| postgres: |
| image: postgres |
| restart: unless-stopped |
| container_name: postgres |
| hostname: postgres |
| environment: |
| POSTGRES_DB: 'metastore_db' |
| POSTGRES_USER: 'hive' |
| POSTGRES_PASSWORD: 'password' |
| ports: |
| - '5432:5432' |
| volumes: |
| - hive-db:/var/lib/postgresql |
| networks: |
| - hive |
| |
| metastore: |
| image: apache/hive:${HIVE_VERSION} |
| depends_on: |
| - postgres |
| restart: unless-stopped |
| container_name: metastore |
| hostname: metastore |
| environment: |
| DB_DRIVER: postgres |
| SERVICE_NAME: 'metastore' |
| SERVICE_OPTS: '-Xmx1G -Djavax.jdo.option.ConnectionDriverName=org.postgresql.Driver |
| -Djavax.jdo.option.ConnectionURL=jdbc:postgresql://postgres:5432/metastore_db |
| -Djavax.jdo.option.ConnectionUserName=hive |
| -Djavax.jdo.option.ConnectionPassword=password' |
| ports: |
| - '9083:9083' |
| volumes: |
| - warehouse:/opt/hive/data/warehouse |
| - type: bind |
| source: ${POSTGRES_LOCAL_PATH} |
| target: /opt/hive/lib/postgres.jar |
| networks: |
| - hive |
| |
| hiveserver2: |
| image: apache/hive:${HIVE_VERSION} |
| depends_on: |
| - metastore |
| restart: unless-stopped |
| container_name: hiveserver2 |
| environment: |
| HIVE_SERVER2_THRIFT_PORT: 10000 |
| SERVICE_OPTS: '-Xmx1G -Dhive.metastore.uris=thrift://metastore:9083' |
| IS_RESUME: 'true' |
| SERVICE_NAME: 'hiveserver2' |
| ports: |
| - '10000:10000' |
| - '10002:10002' |
| volumes: |
| - warehouse:/opt/hive/data/warehouse |
| networks: |
| - hive |
| |
| volumes: |
| hive-db: |
| warehouse: |
| |
| networks: |
| hive: |
| name: hive |