#!/bin/bash mkdir -p /lib/jvm mkdir -p /opt if [ ! -x /lib/jvm/jdk* ]; then unzip /usr/src/jdk*.zip -d /lib/jvm/ fi if [ ! -x /opt/hadoop ]; then tar zxvf /usr/src/hadoop-*.tar.gz -C /opt/ ln -s /opt/hadoop-* /opt/hadoop fi cp -R /usr/src/conf-examples/ /opt/hadoop/ mv /opt/hadoop/conf/ /opt/hadoop/conf-org ln -s /opt/hadoop/conf-examples/ /opt/hadoop/conf export JAVA_HOME=$(dirname /lib/jvm/jdk*/bin/) echo export JAVA_HOME=$JAVA_HOME >> /opt/hadoop/conf/hadoop-env.sh echo export HADOOP_HOME=/opt/hadoop >> /opt/hadoop/conf/hadoop-env.sh echo export HADOOP_CLASSPATH=/opt/hadoop >> /opt/hadoop/conf/hadoop-env.sh echo export HADOOP_CONF_DIR=/opt/hadoop/conf >> /opt/hadoop/conf/hadoop-env.sh echo export JAVA_HOME=$JAVA_HOME >> /etc/profile echo "export PATH=/opt/hadoop/bin/:$JAVA_HOME/bin:\$PATH" >> /etc/profile cd $JAVA_HOME chmod a+x `find . -name "*.exe"` chmod a+x `find . -name "*.dll"` javac -version cd /opt/hadoop bin/hadoop namenode -format /bin/start-hadoop bin/hadoop fs -mkdir tmp echo "/bin/stop-hadoop" > ~/.bash_logout echo "/bin/stop-hadoop" > /etc/skel/.bash_logout cygstart http://localhost:50070 cygstart http://localhost:50030 exit