Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CBA75E76C for ; Thu, 3 Jan 2013 20:14:42 +0000 (UTC) Received: (qmail 91828 invoked by uid 500); 3 Jan 2013 20:14:42 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 91799 invoked by uid 500); 3 Jan 2013 20:14:42 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 91791 invoked by uid 99); 3 Jan 2013 20:14:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2013 20:14:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Jan 2013 20:14:39 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 422EE23889DE; Thu, 3 Jan 2013 20:14:19 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1428571 - /accumulo/trunk/bin/bootstrap_hdfs.sh Date: Thu, 03 Jan 2013 20:14:19 -0000 To: commits@accumulo.apache.org From: kturner@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130103201419.422EE23889DE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kturner Date: Thu Jan 3 20:14:18 2013 New Revision: 1428571 URL: http://svn.apache.org/viewvc?rev=1428571&view=rev Log: ACCUMULO-865 applied patch from dave marion with sligh modifications Added: accumulo/trunk/bin/bootstrap_hdfs.sh (with props) Added: accumulo/trunk/bin/bootstrap_hdfs.sh URL: http://svn.apache.org/viewvc/accumulo/trunk/bin/bootstrap_hdfs.sh?rev=1428571&view=auto ============================================================================== --- accumulo/trunk/bin/bootstrap_hdfs.sh (added) +++ accumulo/trunk/bin/bootstrap_hdfs.sh Thu Jan 3 20:14:18 2013 @@ -0,0 +1,68 @@ +#! /usr/bin/env bash + +# 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. + + +bin=`dirname "$0"` +bin=`cd "$bin"; pwd` + +. "$bin"/config.sh + +# +# Find the system context directory in HDFS +# +SYSTEM_CONTEXT_HDFS_DIR=`grep -A1 "general.vfs.classpaths" $ACCUMULO_HOME/conf/accumulo-site.xml | tail -1 | perl -pe 's/\s+//; s/<\/value>//; print $ARGV[1]'` + +if [ -z $SYSTEM_CONTEXT_HDFS_DIR ]; then + + echo "Your accumulo-site.xml file is not set up for the HDFS Classloader. Please add the following to your accumulo-site.xml file:" + echo "" + echo "" + echo " general.vfs.classpaths" + echo " hdfs://host:port/dir" + echo " location of the jars for the default (system) context" + echo "" + exit +fi + +# +# Create the system context directy in HDFS if it does not exist +# +$HADOOP_HOME/bin/hadoop fs -ls $SYSTEM_CONTEXT_HDFS_DIR > /dev/null +if [ $? -ne 0 ]; then + $HADOOP_HOME/bin/hadoop fs -mkdir $SYSTEM_CONTEXT_HDFS_DIR > /dev/null +fi + +# +# Replicate to all slaves to avoid network contention on startup +# +NUM_SLAVES=`wc -l $ACCUMULO_HOME/conf/slaves | grep -P '^\d+(?= )' -o` +$HADOOP_HOME/bin/hadoop fs -setrep -R $NUM_SLAVES $SYSTEM_CONTEXT_HDFS_DIR > /dev/null + +# +# Copy all jars in lib to the system context directory +# +hadoop fs -moveFromLocal $ACCUMULO_HOME/lib/*.jar $SYSTEM_CONTEXT_HDFS_DIR > /dev/null + +# +# We need two of the jars in lib, copy them back out and remove them from the system context dir +# +hadoop fs -copyToLocal $SYSTEM_CONTEXT_HDFS_DIR/log4j-1.2.16.jar $ACCUMULO_HOME/lib/. > /dev/null +hadoop fs -rmr $SYSTEM_CONTEXT_HDFS_DIR/log4j-1.2.16.jar > /dev/null +hadoop fs -copyToLocal $SYSTEM_CONTEXT_HDFS_DIR/commons-vfs2-2.0.jar $ACCUMULO_HOME/lib/. > /dev/null +hadoop fs -rmr $SYSTEM_CONTEXT_HDFS_DIR/commons-vfs2-2.0.jar > /dev/null +hadoop fs -copyToLocal $SYSTEM_CONTEXT_HDFS_DIR/accumulo-start-${ACCUMULO_VERSION}.jar $ACCUMULO_HOME/lib/. > /dev/null +hadoop fs -rmr $SYSTEM_CONTEXT_HDFS_DIR/accumulo-start-${ACCUMULO_VERSION}.jar > /dev/null Propchange: accumulo/trunk/bin/bootstrap_hdfs.sh ------------------------------------------------------------------------------ svn:executable = *