Install Hadoop on Ubuntu with two computers

This post is about the installation of Hadoop on Ubuntu with two computers. The system environment is Ubuntu 12.04, JDK 6, Hadoop 1.0.3. The information of two computers detail as follow:

hostnameIP addressRole
master192.168.0.10Namenode, Jobtracker, SecondaryNameNode
slave01192.168.0.11Datanode, Tasktracker

Supposing that the hadoop is installed, detail information : http://blog.csdn.net/hero_hegang/article/details/8910438.

Copying the virtual machine with hadoop to other physical machine. You had better configure the static IP address.

Step 1: modify the hosts mapping

$ sudo vi /etc/hosts

#type and add the contents as follows:

192.168.0.10 master
192.168.0.11 slave01

 

Step 2: modify the hostname

$ sudo vi /etc/hostname

#type and add the contents respectively as follows:

# the hostname of 192.168.0.10 is master.

# the hostname of 192.168.0.11 is slave01.

 

Step 3: test the ssh in master shell

$ ssh slave01

#If you don't enter the password, configure successfully.

 

Step 4: modify the hadoop configure file in master and slave with same confiurations

# modify core-site.xml, mapred-site.xml,masters, slaves as follows:

# modify the property fs.default.name tohdfs://master:9000 in core-site.xml.

# modify the property mapred.job.tracker to master:9001 in core-site.xml.

# modify the content of masters file to master.

# modify the content of slaves file to slave01.

 

Step 5: delete the contents of directory of dfs.data.dir in hdfs-site.xml in master and slave machines

$sudo rm -r /home/hadoop/data1/*

$sudo rm -r /home/hadoop/data2/*

 

Step 6: close the firewall in master and slave machines

$ sudo ufw disable

 

Step 7: reformat the namenode in master

$ bin/hadoop namenode -format

 

Step 8: see the process in masters and slave machines

$ jps

$ ssh slave01

$ jps

 

Step 9: see the report of hadoop

$ bin/hadoop dfsadmin -report

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值