安装环境:
1.ubuntu9.10
2.hadoop-0.20.1,Pseudo-Distributed Operation,目前是在自己的Notebook上安装,所以先选择这个模式,下学期在实验室环境下安装Fully-Distributed Operation
安装JAVA环境:
1.安装Java环境:
Open a shell prompt (terminal) and type the following to install JDK and JRE:
$ sudo apt-get install sun-java6-bin sun-java6-jre sun-java6-jdk
|
2.更新
updates all alternatives belonging to one runtime or development kit for the Java language
$ sudo update-java-alternatives -s java-6-sun
|
3.默认的Java安装路径是/usr/lib/jvm
4.设置环境变量JAVA_HOME和PATH
$ vi $HOME/.bash_rc
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:$JAVA_HOME/bin
|
5.OK,写个Java代码测试一下环境是否Available...
下面开始安装hadoop
1.下载hadoop-0.20.1,解压到~/hadoop目录下(这个当然是按自己需求指定的)。cd到源码主目录下。
2.修改conf/hadoop-env.sh to define at least
JAVA_HOME to be the root of your Java installation。
也就是把带有JAVA_HOME的一行改为:
export JAVA_HOME=/usr/lib/jvm/java-6-sun
|
3.修改下面三个配置文件
conf/core-site.xml:
<configuration>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:9000</value>
</property>
</configuration>
conf/hdfs-site.xml:
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
</configuration>
conf/mapred-site.xml:
<configuration>
<property>
<name>mapred.job.tracker</name>
<value>localhost:9001</value>
</property>
</configuration>
|
Setup passphraseless ssh
Now check that you can ssh to the localhost without a passphrase:
$ ssh localhost
If you cannot ssh to localhost without a passphrase, execute the
following commands:
$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
Execution
Format a new distributed-filesystem:
$ bin/hadoop namenode -format
Start the hadoop daemons:
$ bin/start-all.sh
Browse the web interface for the NameNode and the JobTracker; by
default they are available at:
NameNode -
JobTracker -
我的firefox开了学校的代理,导致最开始不能访问上面的地址,折腾了一下才找出这个原因。
接下来的任务:在该环境下试运行mapreduce的程序参考地址:
阅读(1574) | 评论(0) | 转发(0) |