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

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

開另一個視窗避免 CTRL+C 把 java 子程序全砍了 - 暫時無法在 Cygwin 網站找到解法
http://www.mail-archive.com/cygwin@cygwin.com/msg104921.html

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