You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whirr.apache.org by to...@apache.org on 2012/03/27 19:31:09 UTC

svn commit: r1305918 - in /whirr/branches/branch-0.7: CHANGES.txt services/cdh/src/main/resources/functions/configure_cdh_zookeeper.sh

Author: tomwhite
Date: Tue Mar 27 17:31:08 2012
New Revision: 1305918

URL: http://svn.apache.org/viewvc?rev=1305918&view=rev
Log:
WHIRR-572. Ensure ZooKeeper data directories are created.

Modified:
    whirr/branches/branch-0.7/CHANGES.txt
    whirr/branches/branch-0.7/services/cdh/src/main/resources/functions/configure_cdh_zookeeper.sh

Modified: whirr/branches/branch-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/whirr/branches/branch-0.7/CHANGES.txt?rev=1305918&r1=1305917&r2=1305918&view=diff
==============================================================================
--- whirr/branches/branch-0.7/CHANGES.txt (original)
+++ whirr/branches/branch-0.7/CHANGES.txt Tue Mar 27 17:31:08 2012
@@ -38,6 +38,8 @@ Release 0.7.2
 
     WHIRR-570. Site generation fails for YARN. (tomwhite)
 
+    WHIRR-572. Ensure ZooKeeper data directories are created. (tomwhite)
+
 Release 0.7.1 - 2012-02-23
 
   IMPROVEMENTS

Modified: whirr/branches/branch-0.7/services/cdh/src/main/resources/functions/configure_cdh_zookeeper.sh
URL: http://svn.apache.org/viewvc/whirr/branches/branch-0.7/services/cdh/src/main/resources/functions/configure_cdh_zookeeper.sh?rev=1305918&r1=1305917&r2=1305918&view=diff
==============================================================================
--- whirr/branches/branch-0.7/services/cdh/src/main/resources/functions/configure_cdh_zookeeper.sh (original)
+++ whirr/branches/branch-0.7/services/cdh/src/main/resources/functions/configure_cdh_zookeeper.sh Tue Mar 27 17:31:08 2012
@@ -44,6 +44,15 @@ dataDir=/var/log/zookeeper/txlog
 clientPort=2181
 # The servers in the ensemble
 EOF
+
+  if [ $CDH_MAJOR_VERSION = "4" ]; then
+    if which dpkg &> /dev/null; then
+      AS_ZK="su -s /bin/bash - zookeeper -c"
+    elif which rpm &> /dev/null; then
+      AS_ZK="/sbin/runuser -s /bin/bash - zookeeper -c"
+    fi
+    $AS_ZK "/usr/bin/zookeeper-server-initialize"
+  fi
   
   if [[ $# -gt 1 ]]; then
     id=1