hadoop-伪分布安装

先决条件

安装jre1.6  rpm包 http://www.java.com/zh_CN/download/manual.jsp

chmod  u+x  jre-6u21-linux-i586-rpm.bin

./jre-6u21-linux-i586-rpm.bin

设置密钥登录不然每次启动时都要输入密码

$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa 
$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

测试密钥登录

ssh localhost 

1. 下载安装文件

wget http://apache.etoak.com/hadoop/core/hadoop-0.20.2/hadoop-0.20.2.tar.gz

2..tar zxvf  hadoop-0.20.2.tar.gz

3.vi  conf/hadoop-env.sh

修改JAVA_HOME为你的jre路径

export JAVA_HOME=/usr/java/jre1.6.0_21/

4. hostname  查看主机名  

看/etc/hosts  内有无记录 没有则添加

 

[root@bogon conf]# hostname

bogon

[root@bogon conf]# cat /etc/hosts

# Do not remove the following line, or various programs

# that require network functionality will fail.

127.0.0.1               localhost.localdomain localhost

::1             localhost6.localdomain6 localhost6

192.168.1.106  bogon

5. 修改配置文件

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>

 

 

6.格式化数据节点

 bin/hadoop namenode -format

7. 启动 

bin/start-all.sh

8. web 访问接口

  • NameNode - http://localhost:50070/
  • JobTracker - http://localhost:50030/

 

 

你可能感兴趣的:(hadoop,职场,休闲)