데이터 베이스 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 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
3 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25 : Myrise에서 모든 것을 잠금 해제하는 방법
4 몇 주 전 By 尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

58 초상화 플랫폼 구축에 알고리즘 적용 58 초상화 플랫폼 구축에 알고리즘 적용 May 09, 2024 am 09:01 AM

1. 58초상화 플랫폼 구축 배경 먼저, 58초상화 플랫폼 구축 배경에 대해 말씀드리겠습니다. 1. 기존 프로파일링 플랫폼의 전통적인 사고로는 더 이상 충분하지 않습니다. 사용자 프로파일링 플랫폼을 구축하려면 여러 비즈니스 라인의 데이터를 통합하여 정확한 사용자 초상화를 구축하는 데이터 웨어하우스 모델링 기능이 필요합니다. 그리고 알고리즘 측면의 기능을 제공해야 하며, 마지막으로 사용자 프로필 데이터를 효율적으로 저장, 쿼리 및 공유하고 프로필 서비스를 제공할 수 있는 데이터 플랫폼 기능도 있어야 합니다. 자체 구축한 비즈니스 프로파일링 플랫폼과 중간 사무실 프로파일링 플랫폼의 주요 차이점은 자체 구축한 프로파일링 플랫폼이 단일 비즈니스 라인에 서비스를 제공하고 필요에 따라 사용자 정의할 수 있다는 것입니다. 모델링하고 보다 일반적인 기능을 제공합니다. 2.58 Zhongtai 초상화 구성 배경의 사용자 초상화

Java 동시 프로그래밍에서 동시성 테스트 및 디버깅을 수행하는 방법은 무엇입니까? Java 동시 프로그래밍에서 동시성 테스트 및 디버깅을 수행하는 방법은 무엇입니까? May 09, 2024 am 09:33 AM

동시성 테스트 및 디버깅 Java 동시 프로그래밍의 동시성 테스트 및 디버깅은 매우 중요하며 다음 기술을 사용할 수 있습니다. 동시성 테스트: 단위 테스트: 단일 동시 작업을 격리하고 테스트합니다. 통합 테스트: 여러 동시 작업 간의 상호 작용을 테스트합니다. 부하 테스트: 부하가 심한 상황에서 애플리케이션의 성능과 확장성을 평가합니다. 동시성 디버깅: 중단점: 스레드 실행을 일시 중지하고 변수를 검사하거나 코드를 실행합니다. 로깅: 스레드 이벤트 및 상태를 기록합니다. 스택 추적: 예외의 원인을 식별합니다. 시각화 도구: 스레드 활동 및 리소스 사용량을 모니터링합니다.

Eclipse에서 서버를 추가하는 방법 Eclipse에서 서버를 추가하는 방법 May 05, 2024 pm 07:27 PM

Eclipse에 서버를 추가하려면 다음 단계를 수행하십시오. 서버 런타임 환경 생성 서버 구성 서버 인스턴스 생성 서버 런타임 환경 선택 서버 인스턴스 구성 서버 배포 프로젝트 시작

Kubernetes Operator를 활용하여 PHP 클라우드 배포를 단순화하는 방법은 무엇입니까? Kubernetes Operator를 활용하여 PHP 클라우드 배포를 단순화하는 방법은 무엇입니까? May 06, 2024 pm 04:51 PM

KubernetesOperator는 다음 단계에 따라 PHP 클라우드 배포를 단순화합니다. Kubernetes 클러스터와 상호 작용하려면 PHPOperator를 설치합니다. PHP 애플리케이션을 배포하고 이미지와 포트를 선언합니다. 로그 가져오기, 설명, 보기 등의 명령을 사용하여 애플리케이션을 관리합니다.

PHP 보안 모범 사례를 구현하는 방법 PHP 보안 모범 사례를 구현하는 방법 May 05, 2024 am 10:51 AM

PHP 보안 모범 사례를 구현하는 방법 PHP는 동적 및 대화형 웹 사이트를 만드는 데 사용되는 가장 인기 있는 백엔드 웹 프로그래밍 언어 중 하나입니다. 그러나 PHP 코드는 다양한 보안 취약점에 취약할 수 있습니다. 이러한 위협으로부터 웹 애플리케이션을 보호하려면 보안 모범 사례를 구현하는 것이 중요합니다. 입력 유효성 검사 입력 유효성 검사는 사용자 입력의 유효성을 검사하고 SQL 삽입과 같은 악의적인 입력을 방지하는 중요한 첫 번째 단계입니다. PHP는 filter_var() 및 preg_match()와 같은 다양한 입력 유효성 검사 함수를 제공합니다. 예: $username=filter_var($_POST['사용자 이름'],FILTER_SANIT

Java 데이터 구조 및 알고리즘: 클라우드 컴퓨팅에 대한 실용 가이드 Java 데이터 구조 및 알고리즘: 클라우드 컴퓨팅에 대한 실용 가이드 May 09, 2024 am 08:12 AM

클라우드 컴퓨팅에서는 방대한 양의 데이터를 관리하고 처리하기 위해 데이터 구조와 알고리즘을 사용하는 것이 중요합니다. 일반적인 데이터 구조에는 배열, 목록, 해시 테이블, 트리 및 그래프가 포함됩니다. 일반적으로 사용되는 알고리즘에는 정렬 알고리즘, 검색 알고리즘 및 그래프 알고리즘이 포함됩니다. 개발자는 Java의 강력한 기능을 활용하여 Java 컬렉션, 스레드로부터 안전한 데이터 구조 및 Apache Commons 컬렉션을 사용하여 이러한 데이터 구조와 알고리즘을 구현할 수 있습니다.

Java 네트워크 프로그래밍에서 일반적으로 사용되는 프로토콜과 라이브러리는 무엇입니까? Java 네트워크 프로그래밍에서 일반적으로 사용되는 프로토콜과 라이브러리는 무엇입니까? May 09, 2024 pm 06:21 PM

Java 네트워크 프로그래밍에 일반적으로 사용되는 프로토콜 및 라이브러리: 프로토콜: TCP, UDP, HTTP, HTTPS, FTP 라이브러리: java.net, java.nio, ApacheHttpClient, Netty, OkHttp

PHP 마이크로서비스의 컨테이너화된 배포에 대한 전체 가이드 PHP 마이크로서비스의 컨테이너화된 배포에 대한 전체 가이드 May 08, 2024 pm 05:06 PM

PHP 마이크로서비스의 컨테이너화된 배포에 대한 전체 가이드 소개 마이크로서비스 아키텍처는 애플리케이션을 독립적이고 느슨하게 결합된 서비스로 분해하는 현대 소프트웨어 개발에서 뜨거운 추세가 되었습니다. 컨테이너화는 이러한 마이크로서비스를 배포하고 관리하는 효과적인 방법을 제공합니다. 이 문서에서는 PHPDocker를 사용하여 마이크로서비스를 컨테이너화하고 배포하는 데 도움이 되는 단계별 가이드를 제공합니다. Docker 기본 사항 Docker는 애플리케이션과 해당 종속 항목을 모두 휴대용 컨테이너에 패키징하는 경량 컨테이너화 플랫폼입니다. 다음 단계에서는 Docker 사용 방법을 설명합니다. #Install Dockersudoapt-getupdatesudoapt-getinstalldock

See all articles