You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whirr.apache.org by ad...@apache.org on 2012/08/04 01:19:12 UTC

svn commit: r1369249 - in /whirr/trunk: CHANGES.txt services/cdh/src/main/resources/functions/configure_cdh_hbase.sh services/cdh/src/main/resources/functions/install_cdh_hbase.sh

Author: adriancole
Date: Fri Aug  3 23:19:12 2012
New Revision: 1369249

URL: http://svn.apache.org/viewvc?rev=1369249&view=rev
Log:
WHIRR-608: CDH HBase configuration uses CDH3 package and service names only

Modified:
    whirr/trunk/CHANGES.txt
    whirr/trunk/services/cdh/src/main/resources/functions/configure_cdh_hbase.sh
    whirr/trunk/services/cdh/src/main/resources/functions/install_cdh_hbase.sh

Modified: whirr/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/whirr/trunk/CHANGES.txt?rev=1369249&r1=1369248&r2=1369249&view=diff
==============================================================================
--- whirr/trunk/CHANGES.txt (original)
+++ whirr/trunk/CHANGES.txt Fri Aug  3 23:19:12 2012
@@ -99,6 +99,8 @@ Trunk (unreleased changes)
 
     WHIRR-605. Upgrade Cassandra to 1.1.2. (Eldon Stegall via adriancole)
 
+    WHIRR-608. CDH HBase configuration uses CDH3 package and service names only (Bruno Dumon via adriancole)
+
   BUG FIXES
 
     WHIRR-582. Yarn service does not build in IntelliJ because of missing Hadoop test dependencies (Frank Scholten)

Modified: whirr/trunk/services/cdh/src/main/resources/functions/configure_cdh_hbase.sh
URL: http://svn.apache.org/viewvc/whirr/trunk/services/cdh/src/main/resources/functions/configure_cdh_hbase.sh?rev=1369249&r1=1369248&r2=1369249&view=diff
==============================================================================
--- whirr/trunk/services/cdh/src/main/resources/functions/configure_cdh_hbase.sh (original)
+++ whirr/trunk/services/cdh/src/main/resources/functions/configure_cdh_hbase.sh Fri Aug  3 23:19:12 2012
@@ -46,6 +46,14 @@ function configure_cdh_hbase() {
   HBASE_HOME=/usr/lib/$HBASE_VERSION
   HBASE_CONF_DIR=/etc/hbase/conf
 
+  REPO=${REPO:-cdh4}
+  CDH_MAJOR_VERSION=$(echo $REPO | sed -e 's/cdh\([0-9]\).*/\1/')
+  if [ $CDH_MAJOR_VERSION = "4" ]; then
+    HBASE_PREFIX=
+  else
+    HBASE_PREFIX=hadoop-
+  fi
+
   case $CLOUD_PROVIDER in
     ec2 | aws-ec2 )
       # Alias /mnt as /data
@@ -89,10 +97,10 @@ function configure_cdh_hbase() {
   for role in $(echo "$ROLES" | tr "," "\n"); do
     case $role in
     hbase-master)
-      install_hbase_daemon hadoop-hbase-master
+      install_hbase_daemon ${HBASE_PREFIX}hbase-master
       ;;
     hbase-regionserver)
-      install_hbase_daemon hadoop-hbase-regionserver
+      install_hbase_daemon ${HBASE_PREFIX}hbase-regionserver
       ;;
     hbase-restserver)
       # not supported
@@ -101,7 +109,7 @@ function configure_cdh_hbase() {
       # not supported
       ;;
     hbase-thriftserver)
-      install_hbase_daemon hadoop-hbase-thrift
+      install_hbase_daemon ${HBASE_PREFIX}hadoop-hbase-thrift
       ;;
     esac
   done
@@ -112,10 +120,10 @@ function configure_cdh_hbase() {
     for role in $(echo "$ROLES" | tr "," "\n"); do
       case $role in
       hbase-master)
-        service hadoop-hbase-master restart
+        service ${HBASE_PREFIX}hbase-master restart
         ;;
       hbase-regionserver)
-        service hadoop-hbase-regionserver restart
+        service ${HBASE_PREFIX}hbase-regionserver restart
         ;;
       hbase-restserver)
         # not supported
@@ -124,7 +132,7 @@ function configure_cdh_hbase() {
         # not supported
         ;;
       hbase-thriftserver)
-        service hadoop-hbase-thrift restart
+        service ${HBASE_PREFIX}hbase-thrift restart
         ;;
       esac
     done

Modified: whirr/trunk/services/cdh/src/main/resources/functions/install_cdh_hbase.sh
URL: http://svn.apache.org/viewvc/whirr/trunk/services/cdh/src/main/resources/functions/install_cdh_hbase.sh?rev=1369249&r1=1369248&r2=1369249&view=diff
==============================================================================
--- whirr/trunk/services/cdh/src/main/resources/functions/install_cdh_hbase.sh (original)
+++ whirr/trunk/services/cdh/src/main/resources/functions/install_cdh_hbase.sh Fri Aug  3 23:19:12 2012
@@ -78,7 +78,7 @@ function install_cdh_hbase() {
       ;;
   esac
   
-  REPO=${REPO:-cdh3}
+  REPO=${REPO:-cdh4}
   HBASE_HOME=/usr/lib/hbase
   
   # up file-max
@@ -95,12 +95,18 @@ function install_cdh_hbase() {
   [ ! -f /etc/hosts ] && echo "127.0.0.1 localhost" > /etc/hosts
 
   register_cloudera_repo
+  CDH_MAJOR_VERSION=$(echo $REPO | sed -e 's/cdh\([0-9]\).*/\1/')
+  if [ $CDH_MAJOR_VERSION = "4" ]; then
+    HBASE_PREFIX=
+  else
+    HBASE_PREFIX=hadoop-
+  fi
   
   if which dpkg &> /dev/null; then
     apt-get update
-    apt-get -y install hadoop-hbase
+    apt-get -y install ${HBASE_PREFIX}hbase
   elif which rpm &> /dev/null; then
-    yum install -y hadoop-hbase
+    yum install -y ${HBASE_PREFIX}hbase
   fi
   
   echo "export HBASE_HOME=$HBASE_HOME" >> ~root/.bashrc