Skip to content

Commit 1e1f0db

Browse files
mneethirajkumaab
andcommitted
RANGER-5441: update Docker setup to support running Zookeeper with Kerberos (apache#808)
Co-authored-by: Abhishek Kumar <[email protected]> (cherry picked from commit 3bd69c1)
1 parent 5c48116 commit 1e1f0db

File tree

5 files changed

+46
-1
lines changed

5 files changed

+46
-1
lines changed

dev-support/ranger-docker/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ TAGSYNC_VERSION=3.0.0-SNAPSHOT
5151
SOLR_VERSION=8.11.2
5252

5353
# Zookeeper Configuration
54-
ZK_VERSION=3.8.4
54+
ZK_VERSION=3.9.2
5555

5656
# Kerberos
5757
KERBEROS_ENABLED=true

dev-support/ranger-docker/docker-compose.ranger.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ services:
7878
image: ranger-zk
7979
container_name: ranger-zk
8080
hostname: ranger-zk.rangernw
81+
volumes:
82+
- ./dist/keytabs/ranger-zk:/etc/keytabs
83+
- ./scripts/wait_for_keytab.sh:/etc/wait_for_keytab.sh
84+
- ./scripts/kdc/krb5.conf:/etc/krb5.conf:ro
85+
- ./scripts/zk/jaas.conf:/etc/zookeeper/jaas.conf
86+
- ./scripts/zk/zookeeper-with-kerberos.sh:/zookeeper-with-kerberos.sh:ro
87+
entrypoint: [ "/bin/bash", "/zookeeper-with-kerberos.sh" ]
8188
networks:
8289
- ranger
8390
ports:

dev-support/ranger-docker/scripts/kdc/entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ function create_keytabs() {
100100
create_principal_and_keytab knox ranger-knox
101101

102102
create_principal_and_keytab HTTP ranger-solr
103+
104+
create_principal_and_keytab zookeeper ranger-zk
103105
}
104106

105107
function create_testusers() {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Server {
2+
com.sun.security.auth.module.Krb5LoginModule required
3+
useKeyTab=true
4+
keyTab="/etc/keytabs/zookeeper.keytab"
5+
storeKey=true
6+
useTicketCache=false
7+
principal="zookeeper/[email protected]";
8+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env bash
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing, software
14+
# distributed under the License is distributed on an "AS IS" BASIS,
15+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
# See the License for the specific language governing permissions and
17+
# limitations under the License.
18+
19+
set -e
20+
21+
if [ "${KERBEROS_ENABLED}" = "true" ]; then
22+
/etc/wait_for_keytab.sh zookeeper.keytab
23+
24+
export ZOO_CFG_EXTRA="authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider requireClientAuthScheme=sasl"
25+
export SERVER_JVMFLAGS="-Djava.security.auth.login.config=/etc/zookeeper/jaas.conf -Dzookeeper.sasl.client=false ${SERVER_JVMFLAGS}"
26+
fi
27+
28+
/docker-entrypoint.sh zkServer.sh start-foreground

0 commit comments

Comments
 (0)