hbase-exporter/tests/hbase/files/hbase-config.sh

44 lines
1.3 KiB
Bash
Raw Normal View History

2021-03-03 18:58:43 +01:00
#!/usr/bin/env bash
2021-03-03 19:23:52 +01:00
set -ueo pipefail
2021-03-03 18:58:43 +01:00
2021-03-06 22:37:01 +01:00
HBASE_VERSION="0.96.1.1"
HBASE_FILE="hbase-${HBASE_VERSION}-hadoop2-bin.tar.gz"
2021-03-07 03:03:47 +01:00
HBASE_DIR="hbase-${HBASE_VERSION}-hadoop2"
2021-03-06 22:37:01 +01:00
#HBASE_URL="https://downloads.apache.org/hbase/${HBASE_VERSION}/${HBASE_FILE}"
HBASE_URL="https://archive.apache.org/dist/hbase/hbase-${HBASE_VERSION}/${HBASE_FILE}"
2021-03-07 03:03:47 +01:00
HBASE_FILE_CKSUM="1625453f839f7d8c86078a131af9731f6df28c59e58870db84913dcbc640d430253134a825de7cec247ea1f0cf232435765e00844ee2e4faf31aeb356955c478"
2021-03-08 01:46:06 +01:00
HBASE_CONFIG_TEMPLATE="hbase/conf/hbase-site.xml.j2"
HBASE_TEST_SUITE_EXECUTABLE="hbase/bin/hbase"
2021-03-03 18:58:43 +01:00
declare -a DEPS=("java")
2021-03-08 01:46:06 +01:00
SCRIPT_PATH=$(dirname "$0")
source $SCRIPT_PATH/setup.sh
2021-03-03 18:58:43 +01:00
2021-03-08 01:46:06 +01:00
create_hbase_config_template() {
2021-03-06 22:37:01 +01:00
read -r -d '' CONFIG <<EOF
2021-03-03 18:58:43 +01:00
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hbase.rootdir</name>
2021-03-08 01:46:06 +01:00
<value>file:///{{ hbase_rootdir }}/hbase</value>
2021-03-03 18:58:43 +01:00
</property>
<property>
<name>hbase.zookeeper.property.dataDir</name>
2021-03-08 01:46:06 +01:00
<value>{{ hbase_datadir }}/zookeeper</value>
2021-03-03 18:58:43 +01:00
</property>
2021-03-04 17:45:34 +01:00
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>
2021-03-03 18:58:43 +01:00
</configuration>
EOF
2021-03-06 22:37:01 +01:00
echo "$CONFIG"
}
2021-03-03 18:58:43 +01:00
check_dependencies
2021-03-08 01:46:06 +01:00
HBASE_CONFIG=$(create_hbase_config_template)
write_file ${HBASE_CONFIG_TEMPLATE} "${HBASE_CONFIG}"