Skip to content

Commit bf3aa92

Browse files
adwk67nightkr
andauthored
feat: HBase resolvable endpoints (#1159)
* patches I * patches I * wip: patch hbase to use listener endpoints * changed rendering * rework patch for UI * Consistently override the advertised ports * add listener endpoint and info port to hbase-site.xml * patch and entrypoint refactoring * hbase: use listener service for region mover * hbase: patch for 2.6.2 endpoints * removed dead variable * Update hbase/stackable/patches/2.6.1/0005-Allow-overriding-ipc-bind-port-and-use-alternative-p.patch Co-authored-by: Natalie Klestrup Röijezon <[email protected]> * Update hbase/stackable/patches/2.6.1/0005-Allow-overriding-ipc-bind-port-and-use-alternative-p.patch Co-authored-by: Natalie Klestrup Röijezon <[email protected]> * review comments: added constants etc. * set RPC_CLIENT_SPECIFY_HOST to true by default * corrected constant descriptions * updated 2.6.2 patch * patch 2.6.1 to reverse bound/advertised properties * property re-working for 2.6.2 * provide advertised port as a fallback, removed changes to test class --------- Co-authored-by: Natalie Klestrup Röijezon <[email protected]>
1 parent d40bf9e commit bf3aa92

6 files changed

+956
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file.
1717
`check-permissions-ownership.sh` provided in stackable-base image ([#1029]).
1818
- hbase: check for correct permissions and ownerships in /stackable folder via
1919
`check-permissions-ownership.sh` provided in stackable-base image ([#1028]).
20+
- hbase: provide patches to implement listener endpoints ([#1159]).
2021
- hive: check for correct permissions and ownerships in /stackable folder via
2122
`check-permissions-ownership.sh` provided in stackable-base image ([#1040]).
2223
- spark-connect-client: A new image for Spark connect tests and demos ([#1034])
@@ -199,6 +200,7 @@ All notable changes to this project will be documented in this file.
199200
[#1151]: https://github.com/stackabletech/docker-images/pull/1151
200201
[#1152]: https://github.com/stackabletech/docker-images/pull/1152
201202
[#1156]: https://github.com/stackabletech/docker-images/pull/1156
203+
[#1159]: https://github.com/stackabletech/docker-images/pull/1159
202204
[#1163]: https://github.com/stackabletech/docker-images/pull/1163
203205
[#1164]: https://github.com/stackabletech/docker-images/pull/1164
204206
[#1165]: https://github.com/stackabletech/docker-images/pull/1165

hbase/hbase/stackable/bin/hbase-entrypoint.sh

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ set -euo pipefail
1111

1212
# master, regionserver, rest
1313
HBASE_ROLE_NAME="$1"
14-
# k8s service name for this role+group combo
15-
# <svc-name>.<namespace>.svc.cluster.local
16-
HBASE_ROLE_SERVICE_NAME="$2"
1714
# 16010 for master, 16020 for regionservers etc.
18-
HBASE_ROLE_SERVICE_PORT="$3"
15+
HBASE_ROLE_SERVICE_PORT="$2"
16+
# master, regionserver, rest_http, rest_https
17+
HBASE_PORT_NAME="$3"
18+
# ui-http or ui-https
19+
HBASE_UI_PORT_NAME="$4"
1920

20-
HBASE_ROLE_SERVICE_HOST="${HOSTNAME}.${HBASE_ROLE_SERVICE_NAME}"
21+
# Needed for regionmover service and for hbase-site.xml (see below)
22+
HBASE_SERVICE_HOST=$(cat /stackable/listener/default-address/address)
2123

22-
REGION_MOVER_OPTS="--regionserverhost ${HBASE_ROLE_SERVICE_HOST}:${HBASE_ROLE_SERVICE_PORT} --operation unload ${REGION_MOVER_OPTS}"
24+
REGION_MOVER_OPTS="--regionserverhost ${HBASE_SERVICE_HOST}:${HBASE_ROLE_SERVICE_PORT} --operation unload ${REGION_MOVER_OPTS}"
2325

2426
prepare_signal_handlers() {
2527
unset term_child_pid
@@ -64,6 +66,7 @@ cp /stackable/tmp/hdfs/core-site.xml /stackable/conf
6466
cp /stackable/tmp/hbase/* /stackable/conf
6567
cp /stackable/tmp/log_config/log4j* /stackable/conf
6668

69+
# Kerberos
6770
if [ -f /stackable/kerberos/krb5.conf ]; then
6871
KERBEROS_REALM=$(grep -oP 'default_realm = \K.*' /stackable/kerberos/krb5.conf)
6972
export KERBEROS_REALM
@@ -72,6 +75,16 @@ if [ -f /stackable/kerberos/krb5.conf ]; then
7275
sed -i -e s/\$\{env\.KERBEROS_REALM\}/"${KERBEROS_REALM}"/g /stackable/conf/hdfs-site.xml
7376
fi
7477

78+
# Service endpoints
79+
HBASE_SERVICE_PORT=$(cat /stackable/listener/default-address/ports/"${HBASE_PORT_NAME}")
80+
HBASE_INFO_PORT=$(cat /stackable/listener/default-address/ports/"${HBASE_UI_PORT_NAME}")
81+
HBASE_LISTENER_ENDPOINT="$HBASE_SERVICE_HOST:$HBASE_INFO_PORT"
82+
83+
sed -i -e s/\$\{HBASE_SERVICE_HOST\}/"${HBASE_SERVICE_HOST}"/g /stackable/conf/hbase-site.xml
84+
sed -i -e s/\$\{HBASE_SERVICE_PORT\}/"${HBASE_SERVICE_PORT}"/g /stackable/conf/hbase-site.xml
85+
sed -i -e s/\$\{HBASE_LISTENER_ENDPOINT\}/"${HBASE_LISTENER_ENDPOINT}"/g /stackable/conf/hbase-site.xml
86+
sed -i -e s/\$\{HBASE_INFO_PORT\}/"${HBASE_INFO_PORT}"/g /stackable/conf/hbase-site.xml
87+
7588
rm -f "${STACKABLE_LOG_DIR}/_vector/shutdown"
7689
prepare_signal_handlers
7790
/stackable/containerdebug --output="${STACKABLE_LOG_DIR}/containerdebug-state.json" --loop &

0 commit comments

Comments
 (0)