首页 数据库 mysql教程 Apache Hadoop 2.2.0集群安装

Apache Hadoop 2.2.0集群安装

Jun 07, 2016 pm 03:14 PM
apache hadoop 安装 用途 集群

用途 此文档描述了如何安装、配置和维护一个重大集群从几个节点到上千节点。 初次接触hadoop建议先从单节点集群开始。 前提 从 Apache 上下载了稳定的版本。 安装 安装hadoop集群通常需要在所有的节点上解压软件或者prm安装。 通常集群中的某一个节点被当做N

用途

此文档描述了如何安装、配置和维护一个重大集群从几个节点到上千节点。

初次接触hadoop建议先从单节点集群开始。

 

前提

Apache 上下载了稳定的版本。

 

安装

安装hadoop集群通常需要在所有的节点上解压软件或者prm安装。

通常集群中的某一个节点被当做NameNode,其他节点作为ResourceManager,这些是主控节点。其他节点被当做DataNode和NodeManager,这些是从节点。

 

非安全模式启动Hadoop

接下来的章节将会阐述如何配置hadoop集群。

配置文件

hadoop中的配置文件有两大类型:

只读型默认配置:core-default.xmlhdfs-default.xmlyarn-default.xml and mapred-default.xml

定制化配置:conf/core-site.xml, conf/hdfs-site.xml, conf/yarn-site.xml and conf/mapred-site.xml.

此外:你可以自己操作hadoop的脚本,在bin目录下可以找到,还有一些配置的环境变量在conf/hadoop-env.sh and yarn-env.sh中。

站点配置:

配置hadoop集群你首先要配置hadoop守护进程执行的环境。

hadoop的守护进程包括NameNode/DataNode and ResourceManager/NodeManager.

hadoop守护进程环境配置

管理员需要使用conf/hadoop-env.sh and conf/yarn-env.sh脚本对hadoop守护进程做环境配置。

首先你要验证JAVA_HOME在所有的节点上是否正确

有时候你需要 HADOOP_PID_DIR and HADOOP_SECURE_DN_PID_DIR目录只能被启动守护进程的用户执行写操作。否则就会出现软连接攻击。

管理员可以利用配置项单独配置进程,配置项如下:

Daemon Environment Variable
 
NameNode HADOOP_NAMENODE_OPTS
DataNode HADOOP_DATANODE_OPTS
Secondary NameNode HADOOP_SECONDARYNAMENODE_OPTS
ResourceManager YARN_RESOURCEMANAGER_OPTS
NodeManager YARN_NODEMANAGER_OPTS
WebAppProxy YARN_PROXYSERVER_OPTS
Map Reduce Job History Server HADOOP_JOB_HISTORYSERVER_OPTS

如要配置Namenode 为parallelGC,那么可以添加如下到hadoop-env.sh中:

 

Python代码  Apache Hadoop 2.2.0集群安装

  1. export HADOOP_NAMENODE_OPTS="-XX:+UseParallelGC ${HADOOP_NAMENODE_OPTS}"  

其他有用的可定制化参数包括:

 

HADOOP_LOG_DIR / YARN_LOG_DIR :进程日志目录,如果不存在会自动创建。

HADOOP_HEAPSIZE / YARN_HEAPSIZE:内存堆大小默认单位为M,如果变量设置成1000 那么堆内存会设置成1000M,默认为1000,如果你需要配置他那么你可以为每个节点单独配置。

 

Daemon Environment Variable
 
ResourceManager YARN_RESOURCEMANAGER_HEAPSIZE
NodeManager YARN_NODEMANAGER_HEAPSIZE
WebAppProxy YARN_PROXYSERVER_HEAPSIZE
Map Reduce Job History Server HADOOP_JOB_HISTORYSERVER_HEAPSIZE

hadoop守护进程非安全模式配置:

此章节是比较重要的参数配置,涉及信息如下:

conf/core-site.xml

Parameter Value Notes
 
fs.defaultFS NameNode URI hdfs://host:port/
io.file.buffer.size 131072 SequenceFiles的读/写缓冲区大小

conf/hdfs-site.xml

NameNode的配置:

Parameter Value Notes
 
dfs.namenode.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.namenode.hosts /dfs.namenode.hosts.exclude List of permitted/excluded DataNodes. If necessary, use these files to control the list of allowable datanodes.
dfs.blocksize 268435456 HDFS blocksize of 256MB for large file-systems.
dfs.namenode.handler.count 100 More NameNode server threads to handle RPCs from large number of DataNodes.

DataNode配置:

Parameter Value Notes
 
dfs.datanode.data.dir Comma separated list of paths on the local filesystem of a DataNode where 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/yarn-site.xml

ResourceManager和NodeManager配置:

Parameter Value Notes
 
yarn.acl.enable true /false Enable ACLs? Defaults to false.
yarn.admin.acl Admin ACL ACL to set admins on the cluster. ACLs are of for comma-separated-usersspacecomma-separated-groups. Defaults to special value of * which means anyone. Special value of just space means no one has access.
yarn.log-aggregation-enable false Configuration to enable or disable log aggregation

ResourceManager配置:

Parameter Value Notes
 
yarn.resourcemanager.address ResourceManager host:port for clients to submit jobs. host:port
yarn.resourcemanager.scheduler.address ResourceManager host:port for ApplicationMasters to talk to Scheduler to obtain resources. host:port
yarn.resourcemanager.resource-tracker.address ResourceManager host:port for NodeManagers. host:port
yarn.resourcemanager.admin.address ResourceManager host:port for administrative commands. host:port
yarn.resourcemanager.webapp.address ResourceManager web-ui host:port. host:port
yarn.resourcemanager.scheduler.class ResourceManager Scheduler class. CapacityScheduler (recommended), FairScheduler(also recommended), or FifoScheduler
yarn.scheduler.minimum-allocation-mb Minimum limit of memory to allocate to each container request at the Resource Manager. In MBs
yarn.scheduler.maximum-allocation-mb Maximum limit of memory to allocate to each container request at the Resource Manager. In MBs
yarn.resourcemanager.nodes.include-path /yarn.resourcemanager.nodes.exclude-path List of permitted/excluded NodeManagers. If necessary, use these files to control the list of allowable NodeManagers.

NodeManager配置:

 

Parameter Value Notes
 
yarn.nodemanager.resource.memory-mb Resource i.e. available physical memory, in MB, for givenNodeManager Defines total available resources on the NodeManager to be made available to running containers
yarn.nodemanager.vmem-pmem-ratio Maximum ratio by which virtual memory usage of tasks may exceed physical memory The virtual memory usage of each task may exceed its physical memory limit by this ratio. The total amount of virtual memory used by tasks on the NodeManager may exceed its physical memory usage by this ratio.
yarn.nodemanager.local-dirs Comma-separated list of paths on the local filesystem where intermediate data is written. Multiple paths help spread disk i/o.
yarn.nodemanager.log-dirs Comma-separated list of paths on the local filesystem where logs are written. Multiple paths help spread disk i/o.
yarn.nodemanager.log.retain-seconds 10800 Default time (in seconds) to retain log files on the NodeManager Only applicable if log-aggregation is disabled.
yarn.nodemanager.remote-app-log-dir /logs HDFS directory where the application logs are moved on application completion. Need to set appropriate permissions. Only applicable if log-aggregation is enabled.
yarn.nodemanager.remote-app-log-dir-suffix logs Suffix appended to the remote log dir. Logs will be aggregated to ${yarn.nodemanager.remote-app-log-dir}/${user}/${thisParam} Only applicable if log-aggregation is enabled.
yarn.nodemanager.aux-services mapreduce_shuffle Shuffle service that needs to be set for Map Reduce applications.

运行历史配置:

Parameter Value Notes
 
yarn.log-aggregation.retain-seconds -1 How long to keep aggregation logs before deleting them. -1 disables. Be careful, set this too small and you will spam the name node.
yarn.log-aggregation.retain-check-interval-seconds -1 Time between checks for aggregated log retention. If set to 0 or a negative value then the value is computed as one-tenth of the aggregated log retention time. Be careful, set this too small and you will spam the name node.

 

conf/mapred-site.xml

MapReduce应用配置:

Parameter Value Notes
 
mapreduce.framework.name yarn Execution framework set to Hadoop YARN.
mapreduce.map.memory.mb 1536 Larger resource limit for maps.
mapreduce.map.java.opts -Xmx1024M Larger heap-size for child jvms of maps.
mapreduce.reduce.memory.mb 3072 Larger resource limit for reduces.
mapreduce.reduce.java.opts -Xmx2560M Larger heap-size for child jvms of reduces.
mapreduce.task.io.sort.mb 512 Higher memory-limit while sorting data for efficiency.
mapreduce.task.io.sort.factor 100 More streams merged at once while sorting files.
mapreduce.reduce.shuffle.parallelcopies 50 Higher number of parallel copies run by reduces to fetch outputs from very large number of maps.

MapReduce 执行历史服务配置:

Parameter Value Notes
 
mapreduce.jobhistory.address MapReduce JobHistory Server host:port Default port is 10020.
mapreduce.jobhistory.webapp.address MapReduce JobHistory Server Web UIhost:port Default port is 19888.
mapreduce.jobhistory.intermediate-done-dir /mr-history/tmp Directory where history files are written by MapReduce jobs.
mapreduce.jobhistory.done-dir /mr-history/done Directory where history files are managed by the MR JobHistory Server.

 

Hadoop机架感知

  HDFS和YARN服务可机架感知的。

NameNode 和ResourceManager通过调用api来获取集群中每个从节点的机架信息。

api以dns名称(或ip)作为一个机架id。

这个模块也是可配置的,通过topology.node.switch.mapping.impl来配置,可以通过命令行参数topology.script.file.name来配置,如果topology.script.file.name没有配置那么默认其ip为机架id。

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
2 周前 By 尊渡假赌尊渡假赌尊渡假赌
仓库:如何复兴队友
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
4 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

PHP 框架性能比较:速度与效率的终极对决 PHP 框架性能比较:速度与效率的终极对决 Apr 30, 2024 pm 12:27 PM

根据基准测试,Laravel在页面加载速度和数据库查询方面表现出色,而CodeIgniter在数据处理方面表现优异。选择PHP框架时,应考虑应用程序规模、流量模式和开发团队技能。

Java 并发编程中如何进行并发测试和调试? Java 并发编程中如何进行并发测试和调试? May 09, 2024 am 09:33 AM

并发测试和调试Java并发编程中的并发测试和调试至关重要,以下技术可供使用:并发测试:单元测试:隔离并测试单个并发任务。集成测试:测试多个并发任务之间的交互。负载测试:评估应用程序在高负载下的性能和可扩展性。并发调试:断点:暂停线程执行并检查变量或执行代码。日志记录:记录线程事件和状态。堆栈跟踪:识别异常源头。可视化工具:监视线程活动和资源使用情况。

eclipse如何添加服务器 eclipse如何添加服务器 May 05, 2024 pm 07:27 PM

要将服务器添加到 Eclipse,请执行以下步骤:创建服务器运行时环境配置服务器创建服务器实例选择服务器运行时环境配置服务器实例启动服务器部署项目

evasive 模块保护您的网站免受应用层 DOS 攻击 evasive 模块保护您的网站免受应用层 DOS 攻击 Apr 30, 2024 pm 05:34 PM

有多种可以导致网站下线的攻击方法,比较复杂的方法要涉及数据库和编程方面的技术知识。一个更简单的方法被称为“拒绝服务DenialOfService”(DOS)攻击。这个攻击方法的名字来源于它的意图:使普通客户或网站访问者的正常服务请求被拒绝。一般来说,有两种形式的DOS攻击:OSI模型的三、四层,即网络层攻击OSI模型的七层,即应用层攻击第一种类型的DOS攻击——网络层,发生于当大量的垃圾流量流向网页服务器时。当垃圾流量超过网络的处理能力时,网站就会宕机。第二种类型的DOS攻击是在应用层,是利用合

算法在 58 画像平台建设中的应用 算法在 58 画像平台建设中的应用 May 09, 2024 am 09:01 AM

一、58画像平台建设背景首先和大家分享下58画像平台的建设背景。1.传统的画像平台传统的思路已经不够,建设用户画像平台依赖数据仓库建模能力,整合多业务线数据,构建准确的用户画像;还需要数据挖掘,理解用户行为、兴趣和需求,提供算法侧的能力;最后,还需要具备数据平台能力,高效存储、查询和共享用户画像数据,提供画像服务。业务自建画像平台和中台类型画像平台主要区别在于,业务自建画像平台服务单条业务线,按需定制;中台平台服务多条业务线,建模复杂,提供更为通用的能力。2.58中台画像建设的背景58的用户画像

如何使用 PHP 部署和维护网站 如何使用 PHP 部署和维护网站 May 03, 2024 am 08:54 AM

要成功部署和维护PHP网站,需要执行以下步骤:选择Web服务器(如Apache或Nginx)安装PHP创建数据库并连接PHP上传代码到服务器设置域名和DNS监控网站维护步骤包括更新PHP和Web服务器、备份网站、监控错误日志和更新内容。

如何实施 PHP 安全最佳实践 如何实施 PHP 安全最佳实践 May 05, 2024 am 10:51 AM

如何实施PHP安全最佳实践PHP是最受欢迎的后端Web编程语言之一,用于创建动态和交互式网站。然而,PHP代码可能容易受到各种安全漏洞的攻击。实施安全最佳实践对于保护您的Web应用程序免受这些威胁至关重要。输入验证输入验证是验证用户输入并防止恶意输入(如SQL注入)的关键第一步。PHP提供了多种输入验证函数,例如filter_var()和preg_match()。示例:$username=filter_var($_POST['username'],FILTER_SANIT

如何利用 Kubernetes Operator simplifiy PHP 云端部署? 如何利用 Kubernetes Operator simplifiy PHP 云端部署? May 06, 2024 pm 04:51 PM

KubernetesOperator可简化PHP云端部署,通过以下步骤实现:安装PHPOperator,以便与Kubernetes集群进行交互。部署PHP应用,声明映像和端口。使用命令管理应用,例如获取、描述和查看日志。

See all articles