source: hadoop4win-setup/hadoop4win-setup.bat @ 236

Last change on this file since 236 was 235, checked in by jazz, 14 years ago
  • modified hadoop4win-setup.bat
    • change the URL of HBASE_MIRROR
    • change the version of HBASE_FILE
    • add installation of Apache ANT
  • add my_packages/ant*
    • related to Apache ANT installation
  • modified my_packages/hadoop/conf-examples/core-site.xml
    • change ${hadoop.tmp.dir} to c:/hadoop4win/var/hadoop
  • modified my_packages/hadoop/conf-examples/hadoop-env.sh
    • set HADOOP_HEAPSIZE to 256 MB
  • modified Makefile
    • change version to 0.1.4
  • Property svn:executable set to *
File size: 6.0 KB
Line 
1@echo off
2
3REM ####################################################################
4REM # Unattended hadoop for windows installation
5REM #
6REM # License     : GPL
7REM # Author      : Jazz Yao-Tsung Wang <jazz@nchc.org.tw>
8REM # Last update : $Date$
9REM # Version   : $Rev$
10REM #
11REM # Usage: hadoop4win-setup.bat
12REM #
13REM # References:
14REM # [1] Henrik Bengtsson, Unattended Cygwin Installation, June 2, 2004.
15REM #     http://www.maths.lth.se/help/windows/cygwin/
16REM # [2] DRBL-WinRoll
17REM #     http://drbl.nchc.org.tw/drbl-winroll
18REM #     This script is modified from winroll-setup.bat
19REM ####################################################################
20
21set JDK_FILE=jdk1.6.0_18.zip
22set ANT_FILE=ant-current-bin.zip
23set HBASE_FILE=hbase-0.20.6.tar.gz
24set HADOOP_FILE=hadoop-0.20.2.tar.gz
25set JDK_MIRROR=http://www.classcloud.org/hadoop4win
26set ANT_MIRROR=http://ftp.twaren.net/Unix/Web/apache/ant/
27set HBASE_MIRROR=http://ftp.twaren.net/Unix/Web/apache/hbase/hbase-0.20.6/
28set HADOOP_MIRROR=http://ftp.twaren.net/Unix/Web/apache/hadoop/core/hadoop-0.20.2
29set CYGWIN_ROOT=C:\hadoop4win
30set LOCAL_REPOSITORY=%cd%
31set CYGWIN_SETUP=%LOCAL_REPOSITORY%\cygwin_mirror\cyg-setup.exe
32set OLDPATH=%PATH%
33set PATH=%PATH%;%cd%\bin
34set CYGWIN=nodosfilewarning
35
36set MY_PACKAGE=%LOCAL_REPOSITORY%\my_packages
37set ANT_SRC=%MY_PACKAGE%\ant\%ANT_FILE%
38set ANT_DES=%CYGWIN_ROOT%\usr\src
39set JDK_SRC=%MY_PACKAGE%\jdk\%JDK_FILE%
40set JDK_DES=%CYGWIN_ROOT%\usr\src
41set HBASE_SRC=%MY_PACKAGE%\hbase\%HBASE_FILE%
42set HBASE_DES=%CYGWIN_ROOT%\usr\src
43set HADOOP_SRC=%MY_PACKAGE%\hadoop\%HADOOP_FILE%
44set HADOOP_DES=%CYGWIN_ROOT%\usr\src
45
46REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
47REM Assert that there exists a valid %LOCAL_REPOSITORY% directory.
48REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
49
50IF NOT EXIST "%LOCAL_REPOSITORY%" (
51  echo "ERROR: %LOCAL_REPOSITORY% DON'T EXIST"
52  exit /B 1
53)
54
55IF NOT EXIST "%LOCAL_REPOSITORY%\cygwin_mirror" (
56  echo "ERROR: %LOCAL_REPOSITORY%\cygwin_mirror DON'T EXIST"
57  exit /B 1
58)
59
60IF NOT EXIST "%LOCAL_REPOSITORY%\cygwin_mirror\release" (
61  echo "ERROR: %LOCAL_REPOSITORY%\cygwin_mirror\release DON'T EXIST"
62  exit /B 1
63)
64
65IF NOT EXIST "%LOCAL_REPOSITORY%\cygwin_mirror\setup.ini" (
66  echo "ERROR: %LOCAL_REPOSITORY%\cygwin_mirror\setup.ini DON'T EXIST"
67  exit /B 1
68)
69
70IF NOT EXIST "%CYGWIN_SETUP%" (
71  echo "ERROR: %CYGWIN_SETUP% DON'T EXIST"
72  exit /B 1
73)
74
75REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
76REM Create a fake installation skeleton for Cygwin setup
77REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
78IF NOT EXIST "%CYGWIN_ROOT%" (
79  mkdir "%CYGWIN_ROOT%"
80)
81
82IF NOT EXIST "%CYGWIN_ROOT%\etc\setup" (
83  mkdir "%CYGWIN_ROOT%\etc\setup"
84) ELSE (
85  del /Q "%CYGWIN_ROOT%\etc\setup\last-*"
86)
87
88REM -- Note that last-* must *not* containing whitespace, e.g. " " etc.
89REM -- This is why there below is no space in front of ">".
90
91echo Install > "%CYGWIN_ROOT%\etc\setup\last-action"
92echo %LOCAL_REPOSITORY% > "%CYGWIN_ROOT%\etc\setup\last-cache"
93echo cygwin_mirror > "%CYGWIN_ROOT%\etc\setup\last-mirror"
94echo "" > "%CYGWIN_ROOT%\etc\setup\setup.rc"
95echo "" > "%CYGWIN_ROOT%\etc\setup\net-method"
96echo "" > "%CYGWIN_ROOT%\etc\setup\net-proxy-host"
97echo "" > "%CYGWIN_ROOT%\etc\setup\net-proxy-port"
98echo "" > "%CYGWIN_ROOT%\etc\setup\extrakeys"
99echo "" > "%CYGWIN_ROOT%\etc\setup\chooser_window_settings"
100echo "" > "%CYGWIN_ROOT%\etc\setup\installed.db"
101echo "" > "%CYGWIN_ROOT%\etc\setup\timestamp"
102
103REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
104REM Finally, run Cygwin setup quietly
105REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
106
107echo To run  %CYGWIN_SETUP% -q -d -L -l "%LOCAL_REPOSITORY%\cygwin_mirror" -R "%CYGWIN_ROOT%"
108
109REM real do cygwin installation
110
111"%CYGWIN_SETUP%" -q -d -L -l "%LOCAL_REPOSITORY%\cygwin_mirror" -R "%CYGWIN_ROOT%"
112REM "%CYGWIN_SETUP%" -q -d -L -l "%LOCAL_REPOSITORY%\cygwin_mirror" -R "%CYGWIN_ROOT%" -P cygrunsrv,file,openssh,perl,procps,ncurses,rsync,sharutils,shutdown,subversion,tcp_wrappers,termcap,unzip,wget,zip,zlib
113
114REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
115REM Installation of Hadoop and JDK
116REM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
117
118IF NOT EXIST "%JDK_SRC%" (
119  wget "%JDK_MIRROR%/%JDK_FILE%" -O "%MY_PACKAGE%\jdk\%JDK_FILE%"
120)
121
122IF NOT EXIST "%ANT_SRC%" (
123  wget "%ANT_MIRROR%/%ANT_FILE%" -O "%MY_PACKAGE%\ant\%ANT_FILE%"
124)
125
126IF NOT EXIST "%HBASE_SRC%" (
127  wget "%HBASE_MIRROR%/%HBASE_FILE%" -O "%MY_PACKAGE%\hbase\%HBASE_FILE%"
128)
129
130IF NOT EXIST "%HADOOP_SRC%" (
131  wget "%HADOOP_MIRROR%/%HADOOP_FILE%" -O "%MY_PACKAGE%\hadoop\%HADOOP_FILE%"
132)
133
134IF NOT EXIST "%JDK_DES%" (
135  mkdir "%JDK_DES%"
136)
137
138IF NOT EXIST "%ANT_DES%" (
139  mkdir "%ANT_DES%"
140)
141
142IF NOT EXIST "%HBASE_DES%" (
143  mkdir "%HBASE_DES%"
144)
145
146IF NOT EXIST "%HADOOP_DES%" (
147  mkdir "%HADOOP_DES%"
148)
149
150IF NOT EXIST "%CYGWIN_ROOT%\lib\jvm" (
151  copy "%JDK_SRC%" "%JDK_DES%"
152)
153
154IF NOT EXIST "%CYGWIN_ROOT%\opt\ant" (
155  copy "%ANT_SRC%" "%ANT_DES%"
156)
157
158IF NOT EXIST "%CYGWIN_ROOT%\opt\hbase" (
159  copy "%HBASE_SRC%" "%HBASE_DES%"
160)
161
162IF NOT EXIST "%CYGWIN_ROOT%\opt\hadoop" (
163  copy "%HADOOP_SRC%" "%HADOOP_DES%"
164)
165
166copy /Y "%MY_PACKAGE%\ant\bin\*" "%CYGWIN_ROOT%\bin"
167copy /Y "%MY_PACKAGE%\hbase\bin\*" "%CYGWIN_ROOT%\bin"
168copy /Y "%MY_PACKAGE%\hadoop\bin\*" "%CYGWIN_ROOT%\bin"
169xcopy /Y /E /I "%MY_PACKAGE%\hadoop\conf-examples" "%HADOOP_DES%\conf-examples"
170
171cls
172echo "====================================================="
173echo " run `hadoop4win-init' to extract Hadoop and JDK to "
174echo " proper PATH. It will format HDFS Namenode, too."
175echo "=====================================================" 
176%CYGWIN_ROOT%\bin\bash --login -c "/bin/hadoop4win-init"
177%CYGWIN_ROOT%\bin\bash --login -c "/bin/hbase-init"
178%CYGWIN_ROOT%\bin\bash --login -c "/bin/ant-init"
179cls
180set PATH=%OLDPATH%
181CALL "%CYGWIN_ROOT%\Cygwin.bat"
Note: See TracBrowser for help on using the repository browser.