This page documents how to build Docker containers for the various Impala daemon processes, suitable for deployment in Docker or another system like Kubernetes that can deploy Docker containers. If you want to do Impala development inside a Docker container, see Impala Development Environment inside Docker instead.


These instructions assume that you have an Impala development environment set up and that you can build Impala and run Impala tests. If not, see "Getting Started" on Impala Home.

You will also need docker installed on your system. I recommend docker-ce on Ubuntu 16.04. See the Jenkins bootstrap script or the Docker documentation for steps to install docker-ce.

Building containers and publishing to your local Docker repo

Building and publishing containers is integrated into the Impala CMake files, with dependencies on all the build artifacts that go into the containers. Building is as simple as:

./ -release -skiptests -ninja -noclean -notests

ninja docker_images
You may want to set USE_CDP_HIVE in bin/ to build containers with Hive 3 support

Note - in future it would be nice if we could have a flag to to also build this target.

You can check if the images are in your local repository with the below command:

$ docker image ls
REPOSITORY                                                                            TAG                 IMAGE ID            CREATED             SIZE
impala_base                                                                           latest              ffb1347a05b7        2 weeks ago         2.91GB
impalad_coord_exec                                                                    latest              dbea9fb26675        4 weeks ago         2.39GB
impalad_coordinator                                                                   latest              bd213630acce        4 weeks ago         2.39GB
statestored                                                                           latest              59372e24a8f7        4 weeks ago         2.39GB
catalogd                                                                              latest              d56a5adf86d0        4 weeks ago         2.39GB
impalad_executor                                                                      latest              a735455d0c83        4 weeks ago         2.39GB

Pushing Images to a Repository

./docker/ is a script that can push the built images to a docker repository. See that script's help for more information.

Running Dockerized Minicluster

As an initial step, you will need to set up a docker bridge network for the dockerized daemons to communicate over. We have a script ./docker/ to automate the setup. See that script for more details. You need to run it with the desired network name as the first argument, as follows:

$ ./docker/ impala-cluster-network
Removing existing network 'impala-cluster-network'
Error: No such network: impala-cluster-network
Create network 'impala-cluster-network'
Gateway is ''
tarmstrong@tarmstrong-box:~/Impala/incubator-impala$ docker network ls
NETWORK ID          NAME                     DRIVER              SCOPE
3a11d08c3503        bridge                   bridge              local
ef2c6011323d        host                     host                local
ad24ced93c4b        impala-cluster-network   bridge              local
a345b0b987e0        none                     null                local

The network setup changed some settings in You need to regenerate cluster configs and restart your minicluster services before starting Impala so that services like HDFS, HMS, etc will listen for connections on your new docker bridge network.

. bin/ && ./bin/ && ./testdata/bin/

Once those services are up, you should be able to run dockerised Impala. If you previously had an Impala minicluster running, you must kill any non-dockerised Impala processes so they are not listening on the same ports used by the dockerized daemons. If the cluster starts up successfully, you should be able to run some queries via impala-shell. --kill --docker_network=impala-cluster-network

Note that querying any existing tables is likely to fail because "localhost" is baked into a lot of metadata. You will need to load, or re-load data before running end-to-end tests.

You can see the running docker containers with "docker ps"

$ docker ps
CONTAINER ID        IMAGE                COMMAND                  CREATED             STATUS              PORTS                                                                          NAMES
af295db2f818        impalad_coord_exec   "/opt/impala/bin/dae…"   2 minutes ago       Up 2 minutes>21000/tcp,>21050/tcp,>25000/tcp   impala-test-cluster-impala-cluster-network-impalad_coord_exec-2
57011eda4ded        impalad_coord_exec   "/opt/impala/bin/dae…"   2 minutes ago       Up 2 minutes>21000/tcp,>21050/tcp,>25000/tcp   impala-test-cluster-impala-cluster-network-impalad_coord_exec-1
7a3caac8ccc0        impalad_coord_exec   "/opt/impala/bin/dae…"   2 minutes ago       Up 2 minutes>21000/tcp,>21050/tcp,>25000/tcp   impala-test-cluster-impala-cluster-network-impalad_coord_exec-0
e54887a3bc2c        catalogd             "/opt/impala/bin/dae…"   2 minutes ago       Up 2 minutes>25020/tcp                                                       impala-test-cluster-impala-cluster-network-catalogd
57cd35033b15        statestored          "/opt/impala/bin/dae…"   2 minutes ago       Up 2 minutes>25010/tcp                                                       impala-test-cluster-impala-cluster-network-statestored

Running Tests

Automated end-to-end tests are run with this job: bootstraps ubuntu16.04 from scratch and runs the tests.

Tips for Working with Dockerized Minicluster

  • The Impala debug pages are mostly exposed on the same ports as the regular minicluster, i.e. localhost:25000, localhost:25001, localhost:25002, localhost:25010, localhost:25020. This is achieved by mapping from the default webserver ports inside the container to the desired ports outside the container. I.e. all of the Impala daemons are exposing their webserver on port 25000 inside the container.
  • If you want to look at logs or other state in a running container, you can use "docker exec" to run a bash process inside a container (using the name or ID from "docker ps"). Inside the container is a very stripped down Ubuntu environment, so it may be missing many commands you're accustomed to!
docker exec -it impala-test-cluster-impala-cluster-network-catalogd /bin/bash
cat /tmp/catalogd.INFO

Switching between Dockerized and Non-Dockerized Minicluster

This is not totally streamlined. Here are some rough notes about the issues you may run into:

  • HMS and Kudu metadata has hostnames embedded in various places, so if you did data load with the non-dockerized cluster, you will likely not be able to access any tables with a dockerized cluster.
  • If you load data with a dockerized cluster, you can generally access tables with the non-dockerized cluster so long as you keep your bridge network around and all of the processes are listening on the bridge network's gateway IP.
  • You will likely need to explicitly kill running impala processes with --kill to avoid port conflicts.

  • No labels