Skip to content

Commit 7cad2c4

Browse files
committed
convert sed calls to config-utils where possible
1 parent 1950f63 commit 7cad2c4

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ HBASE_UI_PORT_NAME="$4"
2020

2121
# Needed for regionmover service and for hbase-site.xml (see below)
2222
HBASE_SERVICE_HOST=$(cat /stackable/listener/default-address/address)
23+
export HBASE_SERVICE_HOST
2324

2425
REGION_MOVER_OPTS="--regionserverhost ${HBASE_SERVICE_HOST}:${HBASE_ROLE_SERVICE_PORT} --operation unload ${REGION_MOVER_OPTS}"
2526

@@ -57,9 +58,9 @@ wait_for_termination() {
5758
set -e
5859
}
5960

60-
# ##################################################################################################
61+
# #############################################################################
6162
# main
62-
# ##################################################################################################
63+
# #############################################################################
6364
mkdir -p /stackable/conf
6465
cp /stackable/tmp/hdfs/hdfs-site.xml /stackable/conf
6566
cp /stackable/tmp/hdfs/core-site.xml /stackable/conf
@@ -70,20 +71,20 @@ cp /stackable/tmp/log_config/log4j* /stackable/conf
7071
if [ -f /stackable/kerberos/krb5.conf ]; then
7172
KERBEROS_REALM=$(grep -oP 'default_realm = \K.*' /stackable/kerberos/krb5.conf)
7273
export KERBEROS_REALM
74+
# the hdfs discovery files are not written by the hbase operator and use
75+
# the dot notation, so they cannot be used with config-utils
7376
sed -i -e s/\$\{env\.KERBEROS_REALM\}/"${KERBEROS_REALM}"/g /stackable/conf/core-site.xml
74-
sed -i -e s/\$\{env\.KERBEROS_REALM\}/"${KERBEROS_REALM}"/g /stackable/conf/hbase-site.xml
7577
sed -i -e s/\$\{env\.KERBEROS_REALM\}/"${KERBEROS_REALM}"/g /stackable/conf/hdfs-site.xml
7678
fi
7779

7880
# Service endpoints
7981
HBASE_SERVICE_PORT=$(cat /stackable/listener/default-address/ports/"${HBASE_PORT_NAME}")
8082
HBASE_INFO_PORT=$(cat /stackable/listener/default-address/ports/"${HBASE_UI_PORT_NAME}")
81-
HBASE_LISTENER_ENDPOINT="$HBASE_SERVICE_HOST:$HBASE_INFO_PORT"
8283

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
84+
export HBASE_SERVICE_PORT
85+
export HBASE_INFO_PORT
86+
87+
config-utils template /stackable/conf/hbase-site.xml
8788

8889
rm -f "${STACKABLE_LOG_DIR}/_vector/shutdown"
8990
prepare_signal_handlers

0 commit comments

Comments
 (0)