hbase-setup: Adjust config

This commit is contained in:
Björn Busse 2021-03-04 17:45:34 +01:00
parent 3e5fe8e9cb
commit f9b1926a74
3 changed files with 7 additions and 25 deletions

View File

@ -37,22 +37,26 @@ download() {
create_config() { create_config() {
printf "Writing config\n" printf "Writing config\n"
cat <<EOF > $1 cat <<EOF > $2
<?xml version="1.0"?> <?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration> <configuration>
<property> <property>
<name>hbase.rootdir</name> <name>hbase.rootdir</name>
<value>file://${1}/hbase</value> <value>file:///${1}/hbase</value>
</property> </property>
<property> <property>
<name>hbase.zookeeper.property.dataDir</name> <name>hbase.zookeeper.property.dataDir</name>
<value>${1}/zookeeper</value> <value>${1}/zookeeper</value>
</property> </property>
<property>
<name>hbase.unsafe.stream.capability.enforce</name>
<value>false</value>
</property>
</configuration> </configuration>
EOF EOF
} }
check_dependencies check_dependencies
download ${HBASE_URL} download ${HBASE_URL}
create_config "hbase-${HBASE_VERSION}/conf/hbase-site.xml" create_config "/tmp" "hbase-${HBASE_VERSION}/conf/hbase-site.xml"

View File

@ -1,22 +0,0 @@
#!/usr/bin/env bash
setup() {
cd ../
./hbase-exporter --zookeeper-server ${ZK_SERVER:-"127.0.0.1:2181"} 2>&1 > /dev/null &
PID=$!
sleep 5
}
test_hbase_exporter_up() {
nc -znu -w1 ${1:-"127.0.0.1"} ${2:-"9010"}
curl -s http://127.0.0.1:9010
}
test_hbase_exporter_zk_connection() {
r=$(curl -s http://127.0.0.1:9010 | grep '^zookeeper_num_live' | cut -d " " -f2)
assert_not_equals "0.0" "$r" "Zookeeper not live"
}
teardown() {
kill "$PID"
}