手机版
你好,游客 登录 注册
背景:
阅读新闻

Hadoop 三台主机小集群建立详解

[日期:2012-05-21] 来源:Linux社区  作者:shitouer [字体:大 中 小]

修改mapred-site.xml

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<!-- Put site-specific property overrides in this file. -->

<configuration>
  <property>
    <name>mapred.job.tracker</name>
    <value>http://master:9001</value>
  </property>
</configuration>

mapred.job.tracker,设置jobtracker所在机器,端口号9001

修改masters

master      

虽然masters内写的是master,但是个人感觉,这个并不是指定master节点,而是配置secondaryNameNode

修改slaves

master
slave1
slave2
配置了集群中所有slave节点

④ 添加Hadoop环境变量,并 source ~/.bash_profile使之生效

export JAVA_HOME=/root/bin/jdk1.6.0_32
export HADOOP_HOME=/root/bin/hadoop-0.20.2
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin

⑤ 将已经配置好的hadoop-0.20.2,分别拷贝到另外两台主机,并做相同配置

⑥ 此时,hadoop的集群配置已经完成,输入hadoop,则可看到hadoop相关的操作

[root@master ~]# hadoop
Usage: hadoop [--config confdir] COMMAND
where COMMAND is one of:
  namenode -format     format the DFS filesystem
  secondarynamenode    run the DFS secondary namenode
  namenode             run the DFS namenode
  datanode             run a DFS datanode
  dfsadmin             run a DFS admin client
  mradmin              run a Map-Reduce admin client
  fsck                 run a DFS filesystem checking utility
  fs                   run a generic filesystem user client
  balancer             run a cluster balancing utility
  jobtracker           run the MapReduce job Tracker node
  pipes                run a Pipes job
  tasktracker          run a MapReduce task Tracker node
  job                  manipulate MapReduce jobs
  queue                get information regarding JobQueues
  version              print the version
  jar <jar>            run a jar file
  distcp <srcurl> <desturl> copy file or directories recursively
  archive -archiveName NAME <src>* <dest> create a hadoop archive
  daemonlog            get/set the log level for each daemon
 or
  CLASSNAME            run the class named CLASSNAME
Most commands print help when invoked w/o parameters.
⑦ 此时,首先格式化hadoop

在命令行里执行,hadoop namenode -format

linux
相关资讯       Hadoop部署 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款