[bitnami/zookeeper] Release 3.9.1-debian-11-r5 (#54678)

Signed-off-by: Bitnami Containers <bitnami-bot@vmware.com>
This commit is contained in:
Bitnami Bot 2024-01-11 08:21:49 +01:00 committed by GitHub
parent 8a4c9c2976
commit 374c576341
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 70 additions and 3 deletions

View File

@ -7,10 +7,10 @@ ARG TARGETARCH
LABEL com.vmware.cp.artifact.flavor="sha256:1e1b4657a77f0d47e9220f0c37b9bf7802581b93214fff7d1bd2364c8bf22e8e" \
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bullseye" \
org.opencontainers.image.created="2023-12-24T07:56:52Z" \
org.opencontainers.image.created="2024-01-09T12:07:48Z" \
org.opencontainers.image.description="Application packaged by VMware, Inc" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.ref.name="3.9.1-debian-11-r4" \
org.opencontainers.image.ref.name="3.9.1-debian-11-r5" \
org.opencontainers.image.title="zookeeper" \
org.opencontainers.image.vendor="VMware, Inc." \
org.opencontainers.image.version="3.9.1"

View File

@ -10,7 +10,7 @@ fi
script=$1
exit_code="${2:-96}"
fail_if_not_present="${3:-y}"
fail_if_not_present="${3:-n}"
if test -f "$script"; then
sh $script

View File

@ -581,3 +581,50 @@ is_zookeeper_running() {
is_zookeeper_not_running() {
! is_zookeeper_running
}
########################
# Check Zookeeper health
# Globals:
# ZOOKEEPER_*
# Arguments:
# None
# Returns:
# 0 when healthy
# 1 when unhealthy
#########################
zookeeper_healthcheck() {
local command=""
local args=()
local port="$ZOO_PORT_NUMBER"
if [[ "$ZOO_TLS_CLIENT_ENABLE" = true ]]; then
port="$ZOO_TLS_PORT_NUMBER"
command="openssl"
args+=("s_client" "-quiet" "-crlf" "-connect" "localhost:${port}")
debug "Running healthcheck command: 'echo \"ruok\" | timeout ${ZOO_HC_TIMEOUT} ${command} ${args[*]} \
-key <(openssl pkcs12 -in ${ZOO_TLS_CLIENT_KEYSTORE_FILE} -nodes -nocerts -passin pass:\$ZOO_TLS_CLIENT_KEYSTORE_PASSWORD) \
-cert <(openssl pkcs12 -in ${ZOO_TLS_CLIENT_KEYSTORE_FILE} -nodes -nokeys -passin pass:\$ZOO_TLS_CLIENT_KEYSTORE_PASSWORD)'"
response=$(echo "ruok" | timeout "$ZOO_HC_TIMEOUT" "$command" "${args[@]}" \
-key <(openssl pkcs12 -in "$ZOO_TLS_CLIENT_KEYSTORE_FILE" -nodes -nocerts -passin pass:"$ZOO_TLS_CLIENT_KEYSTORE_PASSWORD") \
-cert <(openssl pkcs12 -in "$ZOO_TLS_CLIENT_KEYSTORE_FILE" -nodes -nokeys -passin pass:"$ZOO_TLS_CLIENT_KEYSTORE_PASSWORD") 2> /dev/null
)
else
command="nc"
# Only add flag '-q' if OpenBSD netcat is used
if nc -help 2>&1 | grep -q "\[-q seconds\]"; then
args+=("-q" "1")
fi
args+=("-w" "$ZOO_HC_TIMEOUT" "localhost" "$port")
debug "Running healthcheck command: 'echo \"ruok\" | timeout ${ZOO_HC_TIMEOUT} ${command} ${args[*]}'"
response=$(echo "ruok" | timeout "$ZOO_HC_TIMEOUT" "$command" "${args[@]}")
fi
if [[ "$response" =~ "imok" ]]; then
info "Zookeeper healthcheck succeeded"
return 0
else
error "Zookeeper healthcheck failed."
return 1
fi
}

View File

@ -47,6 +47,7 @@ zookeeper_env_vars=(
ZOO_MAX_SESSION_TIMEOUT
ZOO_PRE_ALLOC_SIZE
ZOO_SNAPCOUNT
ZOO_HC_TIMEOUT
ZOO_TLS_CLIENT_ENABLE
ZOO_TLS_PORT_NUMBER
ZOO_TLS_CLIENT_KEYSTORE_FILE
@ -128,6 +129,7 @@ export ZOO_PROMETHEUS_METRICS_PORT_NUMBER="${ZOO_PROMETHEUS_METRICS_PORT_NUMBER:
export ZOO_MAX_SESSION_TIMEOUT="${ZOO_MAX_SESSION_TIMEOUT:-40000}"
export ZOO_PRE_ALLOC_SIZE="${ZOO_PRE_ALLOC_SIZE:-65536}"
export ZOO_SNAPCOUNT="${ZOO_SNAPCOUNT:-100000}"
export ZOO_HC_TIMEOUT="${ZOO_HC_TIMEOUT:-5}"
# ZooKeeper TLS settings
export ZOO_TLS_CLIENT_ENABLE="${ZOO_TLS_CLIENT_ENABLE:-false}"

View File

@ -0,0 +1,18 @@
#!/bin/bash
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0
# shellcheck disable=SC1091
set -o errexit
set -o nounset
set -o pipefail
# set -o xtrace # Uncomment this line for debugging purposes
# Load libraries
. /opt/bitnami/scripts/libzookeeper.sh
# Load Zookeeper environment variables
. /opt/bitnami/scripts/zookeeper-env.sh
zookeeper_healthcheck