tree: a95278ef014626c4ad4a025c3c4126f8c96c57b0 [path history] [tgz]
  1. config/
  2. bootstrap.sh
  3. docker-compose.yml
  4. Dockerfile
  5. README.md
flink-end-to-end-tests/test-scripts/docker-hadoop-secure-cluster/README.md

Apache Hadoop Docker image with Kerberos enabled

This image is modified version of Knappek/docker-hadoop-secure

With bits and pieces added from Lewuathe/docker-hadoop-cluster to extend it to start a proper kerberized Hadoop cluster:

And a lot of added stuff for making this an actual, properly configured, kerberized cluster with proper user/permissions structure.

Versions

  • JDK8
  • Hadoop 2.8.3

Default Environment Variables

NameValueDescription
KRB_REALMEXAMPLE.COMThe Kerberos Realm, more information here
DOMAIN_REALMexample.comThe Kerberos Domain Realm, more information here
KERBEROS_ADMINadmin/adminThe KDC admin user
KERBEROS_ADMIN_PASSWORDadminThe KDC admin password

You can simply define these variables in the docker-compose.yml.

Run image

Clone the project and run

docker-compose up

Usage

Get the container name with docker ps and login to the container with

docker exec -it <container-name> /bin/bash

To obtain a Kerberos ticket, execute

kinit -kt /home/hadoop-user/hadoop-user.keytab hadoop-user

Afterwards you can use hdfs CLI like

hdfs dfs -ls /

Known issues

Unable to obtain Kerberos password

Error

docker-compose up fails for the first time with the error

Login failure for nn/hadoop.docker.com@EXAMPLE.COM from keytab /etc/security/keytabs/nn.service.keytab: javax.security.auth.login.LoginException: Unable to obtain password from user

Solution

Stop the containers with docker-compose down and start again with docker-compose up -d.

JDK 8

Make sure you use download a JDK version that is still available. Old versions can be deprecated by Oracle and thus the download link won't be able anymore.

Get the latest JDK8 Download URL with

curl -s https://lv.binarybabel.org/catalog-api/java/jdk8.json

Java Keystore

If the Keystore has been expired, then create a new keystore.jks:

  1. create private key
openssl genrsa -des3 -out server.key 1024
  1. create csr
openssl req -new -key server.key -out server.csr`
  1. remove passphrase in key
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
  1. create self-signed cert
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
  1. create JKS and import certificate
keytool -import -keystore keystore.jks -alias CARoot -file server.crt`