[hadoop@hadoop02 hadoop]$ cp mapred-site.xml.template mapred-site.xml
[hadoop@hadoop02 hadoop]$ vi /hadoop/hadoop-2.8.2/etc/hadoop/mapred-site.xml
<property>
<name>mapreduce.framework.name</name>
<value>yarn</value>
</property>
<property>
<name>mapreduce.jobhistory.address</name>
<value>hadoop02:10020</value>
</property>
<property>
<name>mapreduce.jobhistory.webapp.address</name>
<value>hadoop02:19888</value>
</property>
4.7 /hadoop/hadoop-2.8.2/etc/hadoop/yarn-site.xml
<property>
<name>yarn.nodemanager.aux-service</name>
<value>mapreduce_shuffle</value>
</property>
<property>
<name>yarn.nodemanager.aux-service.mapreduce.shuffle.class</name>
<value>org.apache.hadoop.mapred.ShuffleHandler</value>
</property>
<property>
<name>yarn.resourcemanager.address</name>
<value>hadoop02:8032</value>
</property>
<property>
<name>yarn.resourcemanager.scheduler.address</name>
<value>hadoop02:8030</value>
</property>
<property>
<name>yarn.resourcemanager.resource-tracker.address</name>
<value>hadoop02:8031</value>
</property>
<property>
<name>yarn.resourcemanager.admin.address</name>
<value>hadoop02:8033</value>
</property>
<property>
<name>yarn.resourcemanager.webapp.address</name>
<value>hadoop02:8088</value>
</property>
5 安装datanode结点
在192.168.169.102上
[hadoop@hadoop02 ~]$ scp -rp hadoop-2.8.2 hadoop@hadoop01:~/
[hadoop@hadoop02 ~]$ scp -rp hadoop-2.8.2 hadoop@hadoop03:~/
6 初始化namenode
[hadoop@hadoop02 ~]$ pwd
/hadoop
[hadoop@hadoop02 ~]$ ./hadoop-2.8.2/bin/hdfs namenode -format
17/11/05 21:10:43 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: user = hadoop
STARTUP_MSG: host = hadoop02/192.168.169.102
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 2.8.2
STARTUP_MSG: classpath = /hadoop/hadoop-2.8.2/etc/hadoop:/hadoop/hadoop-2.8.2/share/hadoop/common/lib/activation-1.1.jar:/hadoop/hadoop-2.8.2/share/hadoop/common/lib/apacheds-i18n-2.0.0-M15.jar:/hadoop/hadoop-
......
STARTUP_MSG: build = https://git-wip-us.apache.org/repos/asf/hadoop.git -r 66c47f2a01ad9637879e95f80c41f798373828fb; compiled by 'jdu' on 2017-10-19T20:39Z
STARTUP_MSG: java = 1.8.0_151
************************************************************/
17/11/05 21:10:43 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
17/11/05 21:10:43 INFO namenode.NameNode: createNameNode [-format]
17/11/05 21:10:43 WARN common.Util: Path /hadoop/hadoop/dfs/name should be specified as a URI in configuration files. Please update hdfs configuration.
17/11/05 21:10:43 WARN common.Util: Path /hadoop/hadoop/dfs/name should be specified as a URI in configuration files. Please update hdfs configuration.
Formatting using clusterid: CID-206dbc0f-21a2-4c5e-bad1-c296ed9f705a
17/11/05 21:10:44 INFO namenode.FSEditLog: Edit logging is async:false
17/11/05 21:10:44 INFO namenode.FSNamesystem: KeyProvider: null
17/11/05 21:10:44 INFO namenode.FSNamesystem: fsLock is fair: true
17/11/05 21:10:44 INFO namenode.FSNamesystem: Detailed lock hold time metrics enabled: false
17/11/05 21:10:44 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit=1000
17/11/05 21:10:44 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-check=true
17/11/05 21:10:44 INFO blockmanagement.BlockManager: dfs.namenode.startup.delay.block.deletion.sec is set to 000:00:00:00.000
17/11/05 21:10:44 INFO blockmanagement.BlockManager: The block deletion will start around 2017 十一月 05 21:10:44
17/11/05 21:10:44 INFO util.GSet: Computing capacity for map BlocksMap
17/11/05 21:10:44 INFO util.GSet: VM type = 64-bit
17/11/05 21:10:44 INFO util.GSet: 2.0% max memory 889 MB = 17.8 MB
17/11/05 21:10:44 INFO util.GSet: capacity = 2^21 = 2097152 entries
17/11/05 21:10:44 INFO blockmanagement.BlockManager: dfs.block.access.token.enable=false
17/11/05 21:10:44 INFO blockmanagement.BlockManager: defaultReplication = 2
17/11/05 21:10:44 INFO blockmanagement.BlockManager: maxReplication = 512
17/11/05 21:10:44 INFO blockmanagement.BlockManager: minReplication = 1
17/11/05 21:10:44 INFO blockmanagement.BlockManager: maxReplicationStreams = 2
17/11/05 21:10:44 INFO blockmanagement.BlockManager: replicationRecheckInterval = 3000
17/11/05 21:10:44 INFO blockmanagement.BlockManager: encryptDataTransfer = false
17/11/05 21:10:44 INFO blockmanagement.BlockManager: maxNumBlocksToLog = 1000
17/11/05 21:10:44 INFO namenode.FSNamesystem: fsOwner = hadoop (auth:SIMPLE)
17/11/05 21:10:44 INFO namenode.FSNamesystem: supergroup = supergroup
17/11/05 21:10:44 INFO namenode.FSNamesystem: isPermissionEnabled = false
17/11/05 21:10:44 INFO namenode.FSNamesystem: HA Enabled: false
17/11/05 21:10:44 INFO namenode.FSNamesystem: Append Enabled: true
17/11/05 21:10:45 INFO util.GSet: Computing capacity for map INodeMap
17/11/05 21:10:45 INFO util.GSet: VM type = 64-bit
17/11/05 21:10:45 INFO util.GSet: 1.0% max memory 889 MB = 8.9 MB
17/11/05 21:10:45 INFO util.GSet: capacity = 2^20 = 1048576 entries
17/11/05 21:10:45 INFO namenode.FSDirectory: ACLs enabled? false
17/11/05 21:10:45 INFO namenode.FSDirectory: XAttrs enabled? true
17/11/05 21:10:45 INFO namenode.NameNode: Caching file names occurring more than 10 times
17/11/05 21:10:45 INFO util.GSet: Computing capacity for map cachedBlocks
17/11/05 21:10:45 INFO util.GSet: VM type = 64-bit
17/11/05 21:10:45 INFO util.GSet: 0.25% max memory 889 MB = 2.2 MB
17/11/05 21:10:45 INFO util.GSet: capacity = 2^18 = 262144 entries
17/11/05 21:10:45 INFO namenode.FSNamesystem: dfs.namenode.safemode.threshold-pct = 0.9990000128746033
17/11/05 21:10:45 INFO namenode.FSNamesystem: dfs.namenode.safemode.min.datanodes = 0
17/11/05 21:10:45 INFO namenode.FSNamesystem: dfs.namenode.safemode.extension = 30000
17/11/05 21:10:45 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.window.num.buckets = 10
17/11/05 21:10:45 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.num.users = 10
17/11/05 21:10:45 INFO metrics.TopMetrics: NNTop conf: dfs.namenode.top.windows.minutes = 1,5,25
17/11/05 21:10:45 INFO namenode.FSNamesystem: Retry cache on namenode is enabled
17/11/05 21:10:45 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis
17/11/05 21:10:45 INFO util.GSet: Computing capacity for map NameNodeRetryCache
17/11/05 21:10:45 INFO util.GSet: VM type = 64-bit
17/11/05 21:10:45 INFO util.GSet: 0.029999999329447746% max memory 889 MB = 273.1 KB
17/11/05 21:10:45 INFO util.GSet: capacity = 2^15 = 32768 entries
17/11/05 21:10:45 INFO namenode.FSImage: Allocated new BlockPoolId: BP-1476203169-192.168.169.102-1509887445494
17/11/05 21:10:45 INFO common.Storage: Storage directory /hadoop/hadoop/dfs/name has been successfully formatted.
17/11/05 21:10:45 INFO namenode.FSImageFormatProtobuf: Saving image file /hadoop/hadoop/dfs/name/current/fsimage.ckpt_0000000000000000000 using no compression
17/11/05 21:10:45 INFO namenode.FSImageFormatProtobuf: Image file /hadoop/hadoop/dfs/name/current/fsimage.ckpt_0000000000000000000 of size 323 bytes saved in 0 seconds.
17/11/05 21:10:45 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
17/11/05 21:10:45 INFO util.ExitUtil: Exiting with status 0
17/11/05 21:10:45 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at hadoop02/192.168.169.102
************************************************************/
[hadoop@hadoop02 ~]$
验证