您好,欢迎访问一九零五行业门户网

hadoop 2.4.1 集群安装一

配置主机名参考hadoop 1.2.1 集群安装一 配置jdk环境参考hadoop1.2.1集群安装二 配置hadoop a:下载解压hadoop http://mirrors.cnnic.cn/apache/hadoop/common/hadoop-2.4.1/hadoop-2.4.1.tar.gz 在/home/jifeng 创建目录 mkdir hadoop hadoop-2.4.1.tar.gz
配置主机名参考 hadoop 1.2.1 集群安装一
配置jdk环境参考hadoop1.2.1集群安装二
配置hadoop
a:下载解压hadoop
http://mirrors.cnnic.cn/apache/hadoop/common/hadoop-2.4.1/hadoop-2.4.1.tar.gz
在/home/jifeng 创建目录   mkdir hadoop
hadoop-2.4.1.tar.gz下载保存到/home/jifeng/hadoop
tar zxf hadoop-1.2.1.tar.gz
b:配置
涉及到的配置文件有7个,在hadoop-2.4.1的目录下:
/etc/hadoop/hadoop-env.sh
/etc/hadoop/yarn-env.sh
/etc/hadoop/slaves
/etc/hadoop/core-site.xml
/etc/hadoop/hdfs-site.xml
/etc/hadoop/mapred-site.xml
/etc/hadoop/yarn-site.xml
以上个别文件默认丌存在的,可以复制相应的template文件获得。
1:hadoop-env.sh
配置 java_home
# copyright 2011 the apache software foundation# # licensed to the apache software foundation (asf) under one# or more contributor license agreements. see the notice file# distributed with this work for additional information# regarding copyright ownership. the asf licenses this file# to you under the apache license, version 2.0 (the# license); you may not use this file except in compliance# with the license. you may obtain a copy of the license at## http://www.apache.org/licenses/license-2.0## unless required by applicable law or agreed to in writing, software# distributed under the license is distributed on an as is basis,# without warranties or conditions of any kind, either express or implied.# see the license for the specific language governing permissions and# limitations under the license.# set hadoop-specific environment variables here.# the only required environment variable is java_home. all others are# optional. when running a distributed configuration it is best to# set java_home in this file, so that it is correctly defined on# remote nodes.# the java implementation to use.export java_home=/home/jifeng/jdk1.7.0_45# the jsvc implementation to use. jsvc is required to run secure datanodes.#export jsvc_home=${jsvc_home}export hadoop_conf_dir=${hadoop_conf_dir:-/etc/hadoop}# extra java classpath elements. automatically insert capacity-scheduler.for f in $hadoop_home/contrib/capacity-scheduler/*.jar; do if [ $hadoop_classpath ]; then export hadoop_classpath=$hadoop_classpath:$f else export hadoop_classpath=$f fidone# the maximum amount of heap to use, in mb. default is 1000.#export hadoop_heapsize=#export hadoop_namenode_init_heapsize=# extra java runtime options. empty by default.export hadoop_opts=$hadoop_opts -djava.net.preferipv4stack=true# command specific options appended to hadoop_opts when specifiedexport hadoop_namenode_opts=-dhadoop.security.logger=${hadoop_security_logger:-info,rfas} -dhdfs.audit.logger=${hdfs_audit_logger:-info,nullappender} $hadoop_namenode_optsexport hadoop_datanode_opts=-dhadoop.security.logger=error,rfas $hadoop_datanode_optsexport hadoop_secondarynamenode_opts=-dhadoop.security.logger=${hadoop_security_logger:-info,rfas} -dhdfs.audit.logger=${hdfs_audit_logger:-info,nullappender} $hadoop_secondarynamenode_optsexport hadoop_nfs3_opts=$hadoop_nfs3_optsexport hadoop_portmap_opts=-xmx512m $hadoop_portmap_opts# the following applies to multiple commands (fs, dfs, fsck, distcp etc)export hadoop_client_opts=-xmx512m $hadoop_client_opts#hadoop_java_platform_opts=-xx:-useperfdata $hadoop_java_platform_opts# on secure datanodes, user to run the datanode as after dropping privilegesexport hadoop_secure_dn_user=${hadoop_secure_dn_user}# where log files are stored. $hadoop_home/logs by default.#export hadoop_log_dir=${hadoop_log_dir}/$user# where log files are stored in the secure data environment.export hadoop_secure_dn_log_dir=${hadoop_log_dir}/${hadoop_hdfs_user}# the directory where pid files are stored. /tmp by default.# note: this should be set to a directory that can only be written to by # the user that will run the hadoop daemons. otherwise there is the# potential for a symlink attack.export hadoop_pid_dir=${hadoop_pid_dir}export hadoop_secure_dn_pid_dir=${hadoop_pid_dir}# a string representing this instance of hadoop. $user by default.export hadoop_ident_string=$user
2:yarn-env.sh配置java_home
# licensed to the apache software foundation (asf) under one or more# contributor license agreements. see the notice file distributed with# this work for additional information regarding copyright ownership.# the asf licenses this file to you under the apache license, version 2.0# (the license); you may not use this file except in compliance with# the license. you may obtain a copy of the license at## http://www.apache.org/licenses/license-2.0## unless required by applicable law or agreed to in writing, software# distributed under the license is distributed on an as is basis,# without warranties or conditions of any kind, either express or implied.# see the license for the specific language governing permissions and# limitations under the license.# user for yarn daemonsexport hadoop_yarn_user=${hadoop_yarn_user:-yarn}# resolve links - $0 may be a softlinkexport yarn_conf_dir=${yarn_conf_dir:-$hadoop_yarn_home/conf}# some java parametersexport java_home=/home/jifeng/jdk1.7.0_45if [ $java_home != ]; then #echo run java in $java_home java_home=$java_homefi if [ $java_home = ]; then echo error: java_home is not set. exit 1fijava=$java_home/bin/javajava_heap_max=-xmx1000m # for setting yarn specific heap sizes please use this# parameter and set appropriately# yarn_heapsize=1000# check envvars which might override default argsif [ $yarn_heapsize != ]; then java_heap_max=-xmx$yarn_heapsizemfi# resource manager specific parameters# specify the max heapsize for the resourcemanager using a numerical value# in the scale of mb. for example, to specify an jvm option of -xmx1000m, set# the value to 1000.# this value will be overridden by an xmx setting specified in either yarn_opts# and/or yarn_resourcemanager_opts.# if not specified, the default value will be picked from either yarn_heapmax# or java_heap_max with yarn_heapmax as the preferred option of the two.#export yarn_resourcemanager_heapsize=1000# specify the max heapsize for the historymanager using a numerical value# in the scale of mb. for example, to specify an jvm option of -xmx1000m, set# the value to 1000.# this value will be overridden by an xmx setting specified in either yarn_opts# and/or yarn_historyserver_opts.# if not specified, the default value will be picked from either yarn_heapmax# or java_heap_max with yarn_heapmax as the preferred option of the two.#export yarn_historyserver_heapsize=1000# specify the jvm options to be used when starting the resourcemanager.# these options will be appended to the options specified as yarn_opts# and therefore may override any similar flags set in yarn_opts#export yarn_resourcemanager_opts=# node manager specific parameters# specify the max heapsize for the nodemanager using a numerical value# in the scale of mb. for example, to specify an jvm option of -xmx1000m, set# the value to 1000.# this value will be overridden by an xmx setting specified in either yarn_opts# and/or yarn_nodemanager_opts.# if not specified, the default value will be picked from either yarn_heapmax# or java_heap_max with yarn_heapmax as the preferred option of the two.#export yarn_nodemanager_heapsize=1000# specify the jvm options to be used when starting the nodemanager.# these options will be appended to the options specified as yarn_opts# and therefore may override any similar flags set in yarn_opts#export yarn_nodemanager_opts=# so that filenames w/ spaces are handled correctly in loops belowifs=# default log directory & fileif [ $yarn_log_dir = ]; then yarn_log_dir=$hadoop_yarn_home/logsfiif [ $yarn_logfile = ]; then yarn_logfile='yarn.log'fi# default policy file for service-level authorizationif [ $yarn_policyfile = ]; then yarn_policyfile=hadoop-policy.xmlfi# restore ordinary behaviourunset ifsyarn_opts=$yarn_opts -dhadoop.log.dir=$yarn_log_diryarn_opts=$yarn_opts -dyarn.log.dir=$yarn_log_diryarn_opts=$yarn_opts -dhadoop.log.file=$yarn_logfileyarn_opts=$yarn_opts -dyarn.log.file=$yarn_logfileyarn_opts=$yarn_opts -dyarn.home.dir=$yarn_common_homeyarn_opts=$yarn_opts -dyarn.id.str=$yarn_ident_stringyarn_opts=$yarn_opts -dhadoop.root.logger=${yarn_root_logger:-info,console}yarn_opts=$yarn_opts -dyarn.root.logger=${yarn_root_logger:-info,console}if [ x$java_library_path != x ]; then yarn_opts=$yarn_opts -djava.library.path=$java_library_pathfi yarn_opts=$yarn_opts -dyarn.policy.file=$yarn_policyfile
3:core-site.xml
fs.defaultfshdfs://feng01:9000io.file.buffer.size131072hadoop.tmp.dirfile:/home/jifeng/hadoop/tmpabase for other temporary directories.hadoop.proxyuser.hduser.hosts*hadoop.proxyuser.hduser.groups*
4:hdfs-site.xml
dfs.namenode.secondary.http-addressfeng01:9001dfs.namenode.name.dirfile:/home/jifeng/hadoop/namedfs.datanode.data.dirfile:/home/jifeng/hadoop/datadfs.replication1dfs.webhdfs.enabledtrue
5:mapred-site.xml
mapreduce.framework.nameyarnmapreduce.jobhistory.addressfeng01:10020mapreduce.jobhistory.webapp.addressfeng01:19888
6:yarn-site.xml
yarn.nodemanager.aux-servicesmapreduce_shuffleyarn.nodemanager.aux-services.mapreduce.shuffle.classorg.apache.hadoop.mapred.shufflehandleryarn.resourcemanager.addressfeng01:8032yarn.resourcemanager.scheduler.addressfeng01:8030yarn.resourcemanager.resource-tracker.addressfeng01:8031yarn.resourcemanager.admin.addressfeng01:8033yarn.resourcemanager.webapp.addressfeng01:8088
7:slaves
[jifeng@feng01 hadoop]$ cat slavesfeng02feng03
配置完成
其它类似信息

推荐信息