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

Last change on this file since 220 was 143, checked in by jazz, 15 years ago

細部微調

  • Property svn:executable set to *
File size: 1.1 KB
RevLine 
[129]1#!/bin/bash
2mkdir -p /lib/jvm
3mkdir -p /opt
[143]4
[129]5if [ ! -x /lib/jvm/jdk* ]; then
6  unzip /usr/src/jdk*.zip -d /lib/jvm/
7fi
[143]8
[129]9if [ ! -x /opt/hadoop ]; then
10  tar zxvf /usr/src/hadoop-*.tar.gz -C /opt/
11  ln -s /opt/hadoop-* /opt/hadoop
[143]12  cp -R /usr/src/conf-examples/ /opt/hadoop/
13  mv /opt/hadoop/conf/ /opt/hadoop/conf-org
14  ln -s /opt/hadoop/conf-examples/ /opt/hadoop/conf
[129]15fi
[143]16
[129]17export JAVA_HOME=$(dirname /lib/jvm/jdk*/bin/)
[136]18echo export JAVA_HOME=$JAVA_HOME >> /opt/hadoop/conf/hadoop-env.sh
19echo export HADOOP_HOME=/opt/hadoop >> /opt/hadoop/conf/hadoop-env.sh
[140]20echo export HADOOP_CLASSPATH=/opt/hadoop >> /opt/hadoop/conf/hadoop-env.sh
21echo export HADOOP_CONF_DIR=/opt/hadoop/conf >> /opt/hadoop/conf/hadoop-env.sh
22echo export JAVA_HOME=$JAVA_HOME >> /etc/profile
23echo "export PATH=/opt/hadoop/bin/:$JAVA_HOME/bin:\$PATH" >> /etc/profile
[129]24cd $JAVA_HOME
25chmod a+x `find . -name "*.exe"`
26chmod a+x `find . -name "*.dll"`
27javac -version
28cd /opt/hadoop
29bin/hadoop namenode -format
[140]30/bin/start-hadoop
31bin/hadoop fs -mkdir tmp
32echo "/bin/stop-hadoop" > ~/.bash_logout
33echo "/bin/stop-hadoop" > /etc/skel/.bash_logout
[129]34cygstart http://localhost:50070
[139]35cygstart http://localhost:50030
36exit
Note: See TracBrowser for help on using the repository browser.