Skip to content

Instantly share code, notes, and snippets.

  • Save ekoontz/596237 to your computer and use it in GitHub Desktop.
Save ekoontz/596237 to your computer and use it in GitHub Desktop.
From 466ef46b43aec9d1943754c50da7298fd548cdab Mon Sep 17 00:00:00 2001
From: Eugene Koontz <[email protected]>
Date: Thu, 23 Sep 2010 16:23:19 -0700
Subject: [PATCH] my config:
1. allow intellij to attach to hbase shell (hbase client)
2. add SecureRpcEngine support per Gary's info
3. enable RBACCoprocessor in config
---
bin/hbase | 1 +
conf/hbase-env.sh | 80 +++---------------------------------------------
conf/hbase-site.xml | 41 +++++++++++++++++++++++++
conf/log4j.properties | 4 ++-
4 files changed, 50 insertions(+), 76 deletions(-)
diff --git a/bin/hbase b/bin/hbase
index 1864a26..5541ad8 100755
--- a/bin/hbase
+++ b/bin/hbase
@@ -218,6 +218,7 @@ unset IFS
# figure out which class to run
if [ "$COMMAND" = "shell" ] ; then
+ HBASE_OPTS="$HBASE_SHELL_OPTS"
CLASS="org.jruby.Main ${HBASE_HOME}/bin/hirb.rb"
elif $in_sources_dir && [ "$COMMAND" = "shell-tests" ] ; then
# Finx maven build classpath
diff --git a/conf/hbase-env.sh b/conf/hbase-env.sh
index a4ae923..f3eb079 100644
--- a/conf/hbase-env.sh
+++ b/conf/hbase-env.sh
@@ -1,76 +1,6 @@
+export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
+export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5006"
+#Warning: only uncomment if you're debugging the shell and intend to attach to it.
+#otherwise, shell won't work well.
#
-#/**
-# * Copyright 2007 The Apache Software Foundation
-# *
-# * Licensed to the Apache Software Foundation (ASF) under one
-# * or more contributor license agreements. See the NOTICE file
-# * distributed with this work for additional information
-# * regarding copyright ownership. The ASF licenses this file
-# * to you under the Apache License, Version 2.0 (the
-# * "License"); you may not use this file except in compliance
-# * with the License. You may obtain a copy of the License at
-# *
-# * http://www.apache.org/licenses/LICENSE-2.0
-# *
-# * Unless required by applicable law or agreed to in writing, software
-# * distributed under the License is distributed on an "AS IS" BASIS,
-# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# * See the License for the specific language governing permissions and
-# * limitations under the License.
-# */
-
-# Set environment variables here.
-
-# The java implementation to use. Java 1.6 required.
-# export JAVA_HOME=/usr/java/jdk1.6.0/
-
-# Extra Java CLASSPATH elements. Optional.
-# export HBASE_CLASSPATH=
-
-# The maximum amount of heap to use, in MB. Default is 1000.
-# export HBASE_HEAPSIZE=1000
-
-# Extra Java runtime options.
-# Below are what we set by default. May only work with SUN JVM.
-# For more on why as well as other possible settings,
-# see http://wiki.apache.org/hadoop/PerformanceTuning
-export HBASE_OPTS="-XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode"
-
-# Uncomment below to enable java garbage collection logging.
-# export HBASE_OPTS="$HBASE_OPTS -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$HBASE_HOME/logs/gc-hbase.log"
-
-# Uncomment and adjust to enable JMX exporting
-# See jmxremote.password and jmxremote.access in $JRE_HOME/lib/management to configure remote password access.
-# More details at: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html
-#
-# export HBASE_JMX_BASE="-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
-# export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10101"
-# export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10102"
-# export HBASE_THRIFT_OPTS="$HBASE_THRIFT_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10103"
-# export HBASE_ZOOKEEPER_OPTS="$HBASE_ZOOKEEPER_OPTS $HBASE_JMX_BASE -Dcom.sun.management.jmxremote.port=10104"
-
-# File naming hosts on which HRegionServers will run. $HBASE_HOME/conf/regionservers by default.
-# export HBASE_REGIONSERVERS=${HBASE_HOME}/conf/regionservers
-
-# Extra ssh options. Empty by default.
-# export HBASE_SSH_OPTS="-o ConnectTimeout=1 -o SendEnv=HBASE_CONF_DIR"
-
-# Where log files are stored. $HBASE_HOME/logs by default.
-# export HBASE_LOG_DIR=${HBASE_HOME}/logs
-
-# A string representing this instance of hbase. $USER by default.
-# export HBASE_IDENT_STRING=$USER
-
-# The scheduling priority for daemon processes. See 'man nice'.
-# export HBASE_NICENESS=10
-
-# The directory where pid files are stored. /tmp by default.
-# export HBASE_PID_DIR=/var/hadoop/pids
-
-# Seconds to sleep between slave commands. Unset by default. This
-# can be useful in large clusters, where, e.g., slave rsyncs can
-# otherwise arrive faster than the master can service them.
-# 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_SHELL_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5007"
diff --git a/conf/hbase-site.xml b/conf/hbase-site.xml
index af4c300..db3e6f2 100644
--- a/conf/hbase-site.xml
+++ b/conf/hbase-site.xml
@@ -22,4 +22,45 @@
*/
-->
<configuration>
+ <property>
+ <name>hbase.rootdir</name>
+ <value>hdfs://ubuntu.foofers.org/hbase</value>
+ </property>
+ <property>
+ <name>hbase.cluster.distributed</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>hbase.regions.server.count.min</name>
+ <value>0</value>
+ </property>
+ <property>
+ <name>hbase.zookeeper.quorum</name>
+ <value>zookeeper.foofers.org</value>
+ </property>
+ <property>
+ <name>hbase.tmp.dir</name>
+ <value>/mnt/hbase</value>
+ </property>
+ <property>
+ <name>hbase.coprocessor.default.classes</name>
+ <value>org.apache.hadoop.hbase.coprocessor.RBACCoprocessor</value>
+ </property>
+
+ <property>
+ <name>hbase.rpc.engine.org.apache.hadoop.hbase.ipc.HMasterInterface</name>
+ <value>org.apache.hadoop.hbase.ipc.SecureRpcEngine</value>
+ </property>
+
+ <property>
+ <name>hbase.rpc.engine.org.apache.hadoop.hbase.ipc.HMasterRegionInterface</name>
+ <value>org.apache.hadoop.hbase.ipc.SecureRpcEngine</value>
+ </property>
+
+ <property>
+ <name>hbase.rpc.engine.org.apache.hadoop.hbase.ipc.HRegionInterface</name>
+ <value>org.apache.hadoop.hbase.ipc.SecureRpcEngine</value>
+ </property>
+
+
</configuration>
diff --git a/conf/log4j.properties b/conf/log4j.properties
index 62b5521..9867d45 100644
--- a/conf/log4j.properties
+++ b/conf/log4j.properties
@@ -1,5 +1,6 @@
# Define some default values that can be overridden by system properties
-hbase.root.logger=INFO,console
+#hbase.root.logger=INFO,console
+hbase.root.logger=DEBUG,console
hbase.log.dir=.
hbase.log.file=hbase.log
@@ -43,6 +44,7 @@ log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{2}:
log4j.logger.org.apache.zookeeper=INFO
#log4j.logger.org.apache.hadoop.fs.FSNamesystem=DEBUG
log4j.logger.org.apache.hadoop.hbase=DEBUG
+log4j.logger.org.apache.hadoop.ipc.HBaseServer=DEBUG
# Make these two classes INFO-level. Make them DEBUG to see more zk debug.
log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKUtil=INFO
log4j.logger.org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher=INFO
--
1.7.1+GitX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment