PageRenderTime 15ms CodeModel.GetById 6ms app.highlight 4ms RepoModel.GetById 2ms app.codeStats 0ms

/scripts/launch-datanode.sh

https://github.com/deltaforge/nebu-app-hadoop
Shell | 29 lines | 19 code | 8 blank | 2 comment | 4 complexity | a7207ed73dbbcca4b5f1d01d4cf18089 MD5 | raw file
 1#!/bin/sh
 2
 3# Usage launch-datanode.sh output-dir datanode-FQDN
 4
 5if [ $# -lt "2" ]; then
 6    echo "Invalid call to $0";
 7    exit 1;
 8fi
 9
10CONFIG=$1
11DATANODE=$2
12
13ssh hadoop@$DATANODE 'test -f .puppetcomplete'
14if [ $? -ne "0" ]; then
15	exit 2;
16fi
17
18scp -r $CONFIG/hadoop hadoop@$DATANODE:
19
20ssh -tt hadoop@$DATANODE '. hadoop/etc/hadoop/sourceAll.sh && $HADOOP_PREFIX/sbin/hadoop-daemon.sh start datanode'
21if [ $? -ne "0" ]; then
22	exit 3;
23fi
24
25ssh -tt hadoop@$DATANODE '. hadoop/etc/hadoop/sourceAll.sh && $HADOOP_PREFIX/sbin/yarn-daemon.sh start nodemanager'
26if [ $? -ne "0" ]; then
27	exit 4;
28fi
29