summaryrefslogtreecommitdiff
path: root/databases/hbase/files
diff options
context:
space:
mode:
Diffstat (limited to 'databases/hbase/files')
-rw-r--r--databases/hbase/files/hbase-env-dist.sh.in5
-rw-r--r--databases/hbase/files/hbase_master.in31
-rw-r--r--databases/hbase/files/hbase_regionserver.in31
-rw-r--r--databases/hbase/files/patch-hbase-daemon.sh18
-rw-r--r--databases/hbase/files/patch-hbase-env.sh29
5 files changed, 114 insertions, 0 deletions
diff --git a/databases/hbase/files/hbase-env-dist.sh.in b/databases/hbase/files/hbase-env-dist.sh.in
new file mode 100644
index 000000000000..d4aa5979a6d1
--- /dev/null
+++ b/databases/hbase/files/hbase-env-dist.sh.in
@@ -0,0 +1,5 @@
+export JAVA_HOME=%%JAVA_HOME%%
+export HBASE_LOG_DIR=%%HBASE_LOG_DIR%%
+export HBASE_PID_DIR=%%HBASE_PID_DIR%%
+export HBASE_HOME=%%PREFIX%%/hbase
+export HBASE_CONF_DIR=%%ETCDIR%%
diff --git a/databases/hbase/files/hbase_master.in b/databases/hbase/files/hbase_master.in
new file mode 100644
index 000000000000..ec7799a1a2af
--- /dev/null
+++ b/databases/hbase/files/hbase_master.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: hbase_master
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# hbase_master_enable (bool): Set to NO by default.
+# Set it to YES to enable HBase master.
+
+. /etc/rc.subr
+
+name=hbase_master
+rcvar=hbase_master_enable
+
+load_rc_config "${name}"
+
+: ${hbase_master_enable:=NO}
+: ${hbase_master_user:=%%HBASE_USER%%}
+
+command="%%PREFIX%%/hbase/bin/hbase-daemon.sh"
+command_args='--config %%ETCDIR%% start master'
+
+stop_cmd=hbase_master_stop
+
+hbase_master_stop () {
+ su -m ${hbase_master_user} -c "${command} --config %%ETCDIR%% stop master"
+}
+
+run_rc_command "$1"
diff --git a/databases/hbase/files/hbase_regionserver.in b/databases/hbase/files/hbase_regionserver.in
new file mode 100644
index 000000000000..8a0d42e16481
--- /dev/null
+++ b/databases/hbase/files/hbase_regionserver.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: hbase_regionserver
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# hbase_regionserver_enable (bool): Set to NO by default.
+# Set it to YES to enable HBase regionserver.
+
+. /etc/rc.subr
+
+name=hbase_regionserver
+rcvar=hbase_regionserver_enable
+
+load_rc_config "${name}"
+
+: ${hbase_regionserver_enable:=NO}
+: ${hbase_regionserver_user:=%%HBASE_USER%%}
+
+command="%%PREFIX%%/hbase/bin/hbase-daemon.sh"
+command_args='--config %%ETCDIR%% start regionserver'
+
+stop_cmd=hbase_regionserver_stop
+
+hbase_regionserver_stop () {
+ su -m ${hbase_regionserver_user} -c "${command} --config %%ETCDIR%% stop regionserver"
+}
+
+run_rc_command "$1"
diff --git a/databases/hbase/files/patch-hbase-daemon.sh b/databases/hbase/files/patch-hbase-daemon.sh
new file mode 100644
index 000000000000..94364f002b33
--- /dev/null
+++ b/databases/hbase/files/patch-hbase-daemon.sh
@@ -0,0 +1,18 @@
+--- bin/hbase-daemon.sh.orig 2014-07-14 09:50:03.000000000 +0400
++++ bin/hbase-daemon.sh 2014-07-23 18:49:15.000000000 +0400
+@@ -89,7 +89,6 @@
+
+ check_before_start(){
+ #ckeck if the process is not running
+- mkdir -p "$HBASE_PID_DIR"
+ if [ -f $pid ]; then
+ if kill -0 `cat $pid` > /dev/null 2>&1; then
+ echo $command running as process `cat $pid`. Stop it first.
+@@ -120,7 +119,6 @@
+ if [ "$HBASE_LOG_DIR" = "" ]; then
+ export HBASE_LOG_DIR="$HBASE_HOME/logs"
+ fi
+-mkdir -p "$HBASE_LOG_DIR"
+
+ if [ "$HBASE_PID_DIR" = "" ]; then
+ HBASE_PID_DIR=/tmp
diff --git a/databases/hbase/files/patch-hbase-env.sh b/databases/hbase/files/patch-hbase-env.sh
new file mode 100644
index 000000000000..ad7406df819b
--- /dev/null
+++ b/databases/hbase/files/patch-hbase-env.sh
@@ -0,0 +1,29 @@
+--- conf/hbase-env.sh.bak 2014-07-15 05:23:39.000000000 +0400
++++ conf/hbase-env.sh 2014-07-28 23:05:05.000000000 +0400
+@@ -19,6 +19,8 @@
+ # * limitations under the License.
+ # */
+
++. %%ETCDIR%%/hbase-env-dist.sh
++
+ # Set environment variables here.
+
+ # This script sets variables multiple times over the course of starting an hbase process,
+@@ -26,7 +28,7 @@
+ # into the startup scripts (bin/hbase, etc.)
+
+ # The java implementation to use. Java 1.6 required.
+-# export JAVA_HOME=/usr/java/jdk1.6.0/
++# export JAVA_HOME=/usr/java/jdk1.6.0/ --> Defined in hbase-env-dist.sh
+
+ # Extra Java CLASSPATH elements. Optional.
+ # export HBASE_CLASSPATH=
+@@ -121,7 +123,7 @@
+ # export HBASE_SLAVE_SLEEP=0.1
+
+ # Tell HBase whether it should manage it's own instance of Zookeeper or not.
+-# export HBASE_MANAGES_ZK=true
++export HBASE_MANAGES_ZK=false
+
+ # The default log rolling policy is RFA, where the log file is rolled as per the size defined for the
+ # RFA appender. Please refer to the log4j.properties file to see more details on this appender.