参考:http://blog.chinaunix.net/uid-22655236-id-3174616.html
1. 下载hadoop-1.1.0.tar.gz
tar -zxvf hadoop-1.1.0.tar.gz
2. cd /usr/lib/jvm/ 找到你安装jave的路径.
然后指明jave的路径:export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-i386
echo $JAVE_HOME
3.cd /root/hadoop-1.1.0/conf
vim hadoop-env.sh
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-i386
4.cp /root/hadoop-1.1.0/src/core/core-default.xml ../../conf/
cp /root/hadoop-1.1.0/src/hdfs/hdfs-default.xml ../../conf/
cp /root/hadoop-1.1.0/src/mapred/mapred-default.xml ../../conf/
mv core-default.xml core-site.xml
vim core-site.xml
<!-- In: conf/core-site.xml -->
<property>
<name>hadoop.tmp.dir</name>
<value>/app/hadoop/tmp</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://localhost:54310</value>
<description>The name of the default file system. A URI whose
scheme and authority determine the FileSystem implementation. The
uri's scheme determines the config property (fs.SCHEME.impl) naming
the FileSystem implementation class. The uri's authority is used to
determine the host, port, etc. for a filesystem.</description>
</property>
mv hdfs-default.xml hdfs-site.xml
vim hdfs-site.xml
<!-- In: conf/hdfs-site.xml -->
<property>
<name>dfs.replication</name>
<value>1</value>
<description>Default block replication.
The actual number of replications can be specified when the file is created.
The default is used if replication is not specified in create time.
</description>
</property>
mv mapred-default.xml mapred-site.xml
vim mapred-site.xml
<!-- In: conf/mapred-site.xml -->
<property>
<name>mapred.job.tracker</name>
<value>localhost:54311</value>
<description>The host and port that the MapReduce job tracker runs
at. If "local", then jobs are run in-process as a single map
and reduce task.
</description>
</property>
5.注意要安装ssh:
sudo apt-cache search openssh*
并启动:
/etc/init.d/ssh restart
6.ubuntu创建ssh无密码登录
ssh-keygen -t rsa
cd /root/.ssh
cat id_rsa.pub >>authorized_keys
ssh localhost可以进行测试看你配置是否成功!
7. cd /root/hadoop-1.1.0
bin/hadoop namenode -format //格式化hdfs文件系统
bin/start-all.sh 启动hadoop相关的进程!
jps 显示相关的jave进程如下:
17779 SecondaryNameNode
18105 TaskTracker
17870 JobTracker
17547 DataNode
19641 Jps
17318 NameNode
//前面是进程号,后面是进程的名字!
bin/stop-all.sh 启动hadoop相关的进程!
注:参考文章:
http://blog.163.com/code4fun@126/blog/static/45776537201001415039101/
http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/
http://blog.csdn.net/sulliy/article/details/7014169
http://blog.csdn.net/hitzhang/article/details/5216292
jps显示在jave环境运行的进程