Sign inSign up

apachehive/hive

By apachehive

•Updated about 3 years ago

Run Apache Hive inside docker container in pseudo-distributed mode

Image
1

607

apachehive/hive repository overview

⁠Images
  • hive:4.0.0-SNAPSHOT Build from branch master, commit id: 7d69a8ce8cebf9a6d255d5aa998584e4e183085c
  • hive:4.0.0-alpha-2 Build from branch branch-4.0.0-alpha-2
⁠Services
  • Metastore

    For a quick start, launch the Metastore with Derby,

    docker run -d -p 9083:9083 --env SERVICE_NAME=metastore --name metastore-standalone apachehive/hive:4.0.0-SNAPSHOT
    

    Everything would be lost when the service is down. In order to save the Hive table's schema and data, start the container with an external Postgres and Volume to keep them respectively,

    docker run -d -p 9083:9083 --env SERVICE_NAME=metastore \
         --env DB_DRIVER=postgres \
         --env SERVICE_OPTS="-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" \
         --mount source=warehouse,target=/opt/hive/data/warehouse \
         --name metastore-standalone apachehive/hive:4.0.0-SNAPSHOT  
    

    If you want to use you own hdfs-site.xml or yarn-site.xml for the service, you can provide the environment variable HIVE_CUSTOM_CONF_DIR for the command. For instance, put the custom configuration file under the directory /opt/hive/conf, then run,

     docker run -d -p 9083:9083 --env SERVICE_NAME=metastore \
          --env DB_DRIVER=postgres -v /opt/hive/conf:/hive_custom_conf --env HIVE_CUSTOM_CONF_DIR=/hive_custom_conf \
          --name metastore apachehive/hive:4.0.0-SNAPSHOT
    
  • HiveServer2

    For a quick start, launch the HiveServer2 with an embedded Metastore,

     docker run -d -p 10000:10000 -p 10002:10002 --env SERVICE_NAME=hiveserver2 --name hiveserver2-standalone apachehive/hive:4.0.0-SNAPSHOT
    

    or specify a remote Metastore if it's available,

     docker run -d -p 10000:10000 -p 10002:10002 --env SERVICE_NAME=hiveserver2 \
          --env SERVICE_OPTS="-Dhive.metastore.uris=thrift://metastore:9083" \
          --env IS_RESUME="true" \
          --name hiveserver2-standalone apachehive/hive:4.0.0-SNAPSHOT
    

    To save the data between container restarts, you can start the HiveServer2 with a Volume,

     docker run -d -p 10000:10000 -p 10002:10002 --env SERVICE_NAME=hiveserver2 \
       --env SERVICE_OPTS="-Dhive.metastore.uris=thrift://metastore:9083" \
       --mount source=warehouse,target=/opt/hive/data/warehouse \
       --env IS_RESUME="true" \
       --name hiveserver2 apachehive/hive:4.0.0-SNAPSHOT
    

Tag summary

Content type

Image

Digest

sha256:74843d718…

Size

933.6 MB

Last updated

about 3 years ago

docker pull apachehive/hive:4.0.0-beta-1-SNAPSHOT