设为首页 收藏本站
查看: 418|回复: 0

[经验分享] Hadoop学习第0天——配置分布式(译)

[复制链接]

尚未签到

发表于 2016-12-11 10:14:33 | 显示全部楼层 |阅读模式


 Prerequisites先决条件


Required Software



  • JavaTM 1.6.x, preferably from Sun, must be installed.至少是JAVA1.6,最好是SUN公司的,而不是Open JDK

  • ssh must be installed and sshd must be running to use the Hadoop scripts that manage remote Hadoop daemons.ssh必须安装(LINUX下这个基本都有),sshd必须启动,因为要管理远程的Hadoop daemons.ssh
  这里要求集群安装ssh,这里需要做机器互信,使得SSH不用输入密码(实际上,下载安装scp复制到其他机器上都需要,否则每次都输入密码。。。)参见:http://lvdccyb.iyunv.com/blog/1163686

Installation安装
  Typically one machine in the cluster is designated as the NameNode and another machine the as JobTracker, exclusively. These are the masters. The rest of the machines in the cluster act as both DataNode and TaskTracker. These are the slaves.
  The root of the distribution is referred to as HADOOP_HOME. All machines in the cluster usually have the same HADOOP_HOME path.
  通常一个集群中的一台机器(节点)被指定为NameNode 而相应的,另一台机器为JobTracker。它们2个都是 masters.通剩下的都是slaves,它们同时是 DataNode 和 TaskTracker。
  
Configuration配置

Configuring the Hadoop Daemons
  This section deals with important parameters to be specified in the following: 
conf/core-site.xml:
 


Parameter
Value
Notes


fs.default.name
URI of NameNode.
hdfs://hostname/

  
conf/hdfs-site.xml:
 


Parameter
Value
Notes


dfs.name.dir
Path on the local filesystem where the NameNode stores the namespace and transactions logs persistently.
If this is a comma-delimited list of directories then the name table is replicated in all of the directories, for redundancy.


dfs.data.dir
Comma separated list of paths on the local filesystem of a DataNodewhere it should store its blocks.
If this is a comma-delimited list of directories, then data will be stored in all named directories, typically on different devices.
  
conf/mapred-site.xml:
 


Parameter
Value
Notes


mapred.job.tracker
Host or IP and port ofJobTracker.

host:port pair.


mapred.system.dir
Path on the HDFS where where the MapReduce framework stores system files e.g./hadoop/mapred/system/.
This is in the default filesystem (HDFS) and must be accessible from both the server and client machines.


mapred.local.dir
Comma-separated list of paths on the local filesystem where temporary MapReduce data is written.
Multiple paths help spread disk i/o.


mapred.tasktracker.{map|reduce}.tasks.maximum
The maximum number of MapReduce tasks, which are run simultaneously on a given TaskTracker, individually.
Defaults to 2 (2 maps and 2 reduces), but vary it depending on your hardware.


dfs.hosts/dfs.hosts.exclude
List of permitted/excluded DataNodes.
If necessary, use these files to control the list of allowable datanodes.


mapred.hosts/mapred.hosts.exclude
List of permitted/excluded TaskTrackers.
If necessary, use these files to control the list of allowable TaskTrackers.


mapred.queue.names
Comma separated list of queues to which jobs can be submitted.
The MapReduce system always supports atleast one queue with the name as default. Hence, this parameter's value should always contain the string default. Some job schedulers supported in Hadoop, like the Capacity Scheduler, support multiple queues. If such a scheduler is being used, the list of configured queue names must be specified here. Once queues are defined, users can submit jobs to a queue using the property name mapred.job.queue.name in the job configuration. There could be a separate configuration file for configuring properties of these queues that is managed by the scheduler. Refer to the documentation of the scheduler for information on the same.


mapred.acls.enabled
Boolean, specifying whether checks for queue ACLs and job ACLs are to be done for authorizing users for doing queue operations and job operations.
If true, queue ACLs are checked while submitting and administering jobs and job ACLs are checked for authorizing view and modification of jobs. Queue ACLs are specified using the configuration parameters of the form mapred.queue.queue-name.acl-name, defined below under mapred-queue-acls.xml. Job ACLs are described at Job Authorization
  
conf/mapred-queue-acls.xml
 


Parameter
Value
Notes


mapred.queue.queue-name.acl-submit-job
List of users and groups that can submit jobs to the specified queue-name.
The list of users and groups are both comma separated list of names. The two lists are separated by a blank. Example: user1,user2 group1,group2. If you wish to define only a list of groups, provide a blank at the beginning of the value.


mapred.queue.queue-name.acl-administer-jobs
List of users and groups that can view job details, change the priority or kill jobs that have been submitted to the specifiedqueue-name.
The list of users and groups are both comma separated list of names. The two lists are separated by a blank. Example: user1,user2 group1,group2. If you wish to define only a list of groups, provide a blank at the beginning of the value. Note that the owner of a job can always change the priority or kill his/her own job, irrespective of the ACLs.
  Typically all the above parameters are marked as final to ensure that they cannot be overriden by user-applications.
  上面太多,于是设置了几项:
  最终的配置如下:

<configuration>
<property> <name>dfs.support.append</name> <value>true</value> </property> <property> <name>dfs.datanode.max.xcievers</name> <value>4096</value> </property> <property> <name>dfs.block.size</name> <value>134217728</value> </property> <property> <name>dfs.namenode.handler.count</name> <value>40</value> </property> </configuration>
  conf/hdfs-site.xml
  conf/hadoop-env.sh
  这里只修改了JAVA_HOME项
  conf/mapred-site.xml

<configuration> <property> <name>mapred.reduce.parallel.copies</name> <value>20</value> </property> </configuration>



  • Hadoop Startup

To start a Hadoop cluster you will need to start both the HDFS and Map/Reduce cluster.

Format a new distributed filesystem:
$ bin/hadoop namenode -format

Start the HDFS with the following command, run on the designated NameNode:
$ bin/start-dfs.sh

The bin/start-dfs.sh script also consults the ${HADOOP_CONF_DIR}/slaves file on the NameNode and starts the DataNode daemon on all the listed slaves.

Start Map-Reduce with the following command, run on the designated JobTracker:
$ bin/start-mapred.sh

The bin/start-mapred.sh script also consults the ${HADOOP_CONF_DIR}/slaves file on the JobTracker and starts the TaskTracker daemon on all the listed slaves.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-312671-1-1.html 上篇帖子: hadoop学习2——DistributedCache的部分用法 下篇帖子: hadoop集群调优-OS和文件系统部分
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表