source: hadoop4win-setup/my_packages/hadoop/bin/hadoop4win-init @ 241

Last change on this file since 241 was 241, checked in by jazz, 14 years ago
  • modified hadoop4win-setup.bat
    • change order of hadoop4win-init and ant-init
  • modified my_packages/ant/bin/ant-init
    • fix typo in echo message
    • use unzip "-d" to change directory
  • modified my_packages/hbase/bin/hbase-init
    • setup hbase.tmp.dir and HBASE_PID_DIR
  • modified my_packages/hadoop/bin/hadoop4win-init
    • use mv and cp instead of symbolic link
    • copy example config as pseudo config
    • force to leave safe mode since Hadoop 0.20.2 need extra 30 seconds to check.
    • add sleep 10 seconds since start-hadoop will take 10 seconds.
  • Property svn:executable set to *
File size: 1.3 KB
RevLine 
[129]1#!/bin/bash
2mkdir -p /lib/jvm
3mkdir -p /opt
[143]4
[129]5if [ ! -x /lib/jvm/jdk* ]; then
[241]6  echo "Installing Sun JDK ...."
[129]7  unzip /usr/src/jdk*.zip -d /lib/jvm/
8fi
[143]9
[129]10if [ ! -x /opt/hadoop ]; then
[241]11  echo "Installing Hadoop ...."
[129]12  tar zxvf /usr/src/hadoop-*.tar.gz -C /opt/
[241]13  mv /opt/hadoop-* /opt/hadoop
14  cp -R /usr/src/conf-examples/ /opt/hadoop/conf-pseudo
15  mv /opt/hadoop/conf/ /opt/hadoop/conf-local
16  ln -s /opt/hadoop/conf-pseudo /opt/hadoop/conf
[129]17fi
[143]18
[129]19export JAVA_HOME=$(dirname /lib/jvm/jdk*/bin/)
[136]20echo export JAVA_HOME=$JAVA_HOME >> /opt/hadoop/conf/hadoop-env.sh
21echo export HADOOP_HOME=/opt/hadoop >> /opt/hadoop/conf/hadoop-env.sh
[140]22echo export HADOOP_CLASSPATH=/opt/hadoop >> /opt/hadoop/conf/hadoop-env.sh
23echo export HADOOP_CONF_DIR=/opt/hadoop/conf >> /opt/hadoop/conf/hadoop-env.sh
24echo export JAVA_HOME=$JAVA_HOME >> /etc/profile
25echo "export PATH=/opt/hadoop/bin/:$JAVA_HOME/bin:\$PATH" >> /etc/profile
[129]26cd $JAVA_HOME
27chmod a+x `find . -name "*.exe"`
28chmod a+x `find . -name "*.dll"`
29cd /opt/hadoop
[236]30/opt/hadoop/bin/hadoop namenode -format
[232]31source /etc/profile
[140]32/bin/start-hadoop
[241]33sleep 10
34/opt/hadoop/bin/hadoop dfsadmin -safemode leave
[236]35/opt/hadoop/bin/hadoop fs -mkdir tmp
[140]36echo "/bin/stop-hadoop" > ~/.bash_logout
37echo "/bin/stop-hadoop" > /etc/skel/.bash_logout
[129]38cygstart http://localhost:50070
[139]39cygstart http://localhost:50030
[236]40exit
Note: See TracBrowser for help on using the repository browser.