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