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 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:
./buildall.sh -release -skiptests -ninja -noclean -notests ninja docker_images |
Note - in future it would be nice if we could have a flag to buildall.sh 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 |
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/configure_test_network.sh 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/configure_test_network.sh impala-cluster-network Removing existing network 'impala-cluster-network' Error: No such network: impala-cluster-network Create network 'impala-cluster-network' ad24ced93c4b0b3cda288294d0a6bee35e05d9b1e4150b503f2adec325810280 Gateway is '172.18.0.1' Updating impala-config-local.sh 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 impala-config-local.sh. 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/impala-config.sh && ./bin/create-test-configuration.sh && ./testdata/bin/run-all.sh |
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.
start-impala-cluster.py --kill start-impala-cluster.py --docker_network=impala-cluster-network impala-shell.sh |
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 0.0.0.0:21002->21000/tcp, 0.0.0.0:21052->21050/tcp, 0.0.0.0:25002->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 0.0.0.0:21001->21000/tcp, 0.0.0.0:21051->21050/tcp, 0.0.0.0:25001->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 0.0.0.0:21000->21000/tcp, 0.0.0.0:21050->21050/tcp, 0.0.0.0:25000->25000/tcp impala-test-cluster-impala-cluster-network-impalad_coord_exec-0 e54887a3bc2c catalogd "/opt/impala/bin/dae…" 2 minutes ago Up 2 minutes 0.0.0.0:25020->25020/tcp impala-test-cluster-impala-cluster-network-catalogd 57cd35033b15 statestored "/opt/impala/bin/dae…" 2 minutes ago Up 2 minutes 0.0.0.0:25010->25010/tcp impala-test-cluster-impala-cluster-network-statestored |
Automated end-to-end tests are run with this job: https://jenkins.impala.io/job/ubuntu-16.04-dockerised-tests/. https://github.com/apache/impala/blob/master/bin/jenkins/dockerized-impala-bootstrap-and-test.sh bootstraps ubuntu16.04 from scratch and runs the tests.
docker exec -it impala-test-cluster-impala-cluster-network-catalogd /bin/bash cat /tmp/catalogd.INFO |
This is not totally streamlined. Here are some rough notes about the issues you may run into: