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
Line 
1#!/bin/bash
2mkdir -p /lib/jvm
3mkdir -p /opt
4
5if [ ! -x /lib/jvm/jdk* ]; then
6  echo "Installing Sun JDK ...."
7  unzip /usr/src/jdk*.zip -d /lib/jvm/
8fi
9
10if [ ! -x /opt/hadoop ]; then
11  echo "Installing Hadoop ...."
12  tar zxvf /usr/src/hadoop-*.tar.gz -C /opt/
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
17fi
18
19export JAVA_HOME=$(dirname /lib/jvm/jdk*/bin/)
20echo export JAVA_HOME=$JAVA_HOME >> /opt/hadoop/conf/hadoop-env.sh
21echo export HADOOP_HOME=/opt/hadoop >> /opt/hadoop/conf/hadoop-env.sh
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
26cd $JAVA_HOME
27chmod a+x `find . -name "*.exe"`
28chmod a+x `find . -name "*.dll"`
29cd /opt/hadoop
30/opt/hadoop/bin/hadoop namenode -format
31source /etc/profile
32/bin/start-hadoop
33sleep 10
34/opt/hadoop/bin/hadoop dfsadmin -safemode leave
35/opt/hadoop/bin/hadoop fs -mkdir tmp
36echo "/bin/stop-hadoop" > ~/.bash_logout
37echo "/bin/stop-hadoop" > /etc/skel/.bash_logout
38cygstart http://localhost:50070
39cygstart http://localhost:50030
40exit
Note: See TracBrowser for help on using the repository browser.