<configuration><property><name>hadoop.tmp.dir</name><value>file:/usr/local/hadoop/tmp</value><description>Abase for other temporary directories.</description></property><property><name>fs.defaultFS</name><value>hdfs://dev-search-01.test:9000</value></property>
</configuration>
cp /usr/local/hadoop/etc/hadoop/mapred-site.xml.template /usr/local/hadoop/etc/hadoop/mapred-site.xml
vim /usr/local/hadoop/etc/hadoop/mapred-site.xml
<configuration><property><name>mapreduce.framework.name</name><value>yarn</value></property><property><name>mapred.job.tracker</name><value>http://dev-search-01.test:9001</value></property>
</configuration>
4.配置yarn-site.xml
<configuration>
<!-- Site specific YARN configuration properties --><property><name>yarn.nodemanager.aux-services</name><value>mapreduce_shuffle</value></property><property><name>yarn.resourcemanager.hostname</name><value>dev-search-01.test</value></property>
</configuration>
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.20/08/05 10:36:03 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Configured Capacity: 158262480896 (147.39 GB)
Present Capacity: 106997108736 (99.65 GB)
DFS Remaining: 106996961280 (99.65 GB)
DFS Used: 147456 (144 KB)
DFS Used%: 0.00%
Under replicated blocks: 0
Blocks with corrupt replicas: 0
Missing blocks: 0-------------------------------------------------
Live datanodes (3):
...
...
[root@dev-search-01 hadoop]# bin/hadoop namenode -format
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.20/08/04 18:51:04 INFO namenode.NameNode: STARTUP_MSG:
/************************************************************
STARTUP_MSG: Starting NameNode
STARTUP_MSG: host = dev-search-01.test/10.76.0.98
STARTUP_MSG: args = [-format]
STARTUP_MSG: version = 2.6.0
STARTUP_MSG: classpath = /.........trib/capacity-scheduler/*.jar:/usr/local/hadoop/contrib/capacity-scheduler/*.jar
STARTUP_MSG: build = https://git-wip-us.apache.org/repos/asf/hadoop.git -r e3496499ecb8d220fba99dc5ed4c99c8f9e33bb1; compiled by 'jenkins' on 2014-11-13T21:10Z
STARTUP_MSG: java = 1.8.0_91
************************************************************/
20/08/04 18:51:04 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
20/08/04 18:51:04 INFO namenode.NameNode: createNameNode [-format]
20/08/04 18:51:04 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
20/08/04 18:51:04 WARN common.Util: Path /usr/local/hadoop/hdfs/name should be specified as a URI in configuration files. Please update hdfs configuration.
20/08/04 18:51:04 WARN common.Util: Path /usr/local/hadoop/hdfs/name should be specified as a URI in configuration files. Please update hdfs configuration.
Formatting using clusterid: CID-48367cf0-3528-4278-b35a-5c8b7ce56693
20/08/04 18:51:04 INFO namenode.FSNamesystem: No KeyProvider found.
20/08/04 18:51:04 INFO namenode.FSNamesystem: fsLock is fair:true
20/08/04 18:51:04 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit=1000
20/08/04 18:51:04 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-check=true
20/08/04 18:51:04 INFO blockmanagement.BlockManager: dfs.namenode.startup.delay.block.deletion.sec is set to 000:00:00:00.000
20/08/04 18:51:04 INFO blockmanagement.BlockManager: The block deletion will start around 2020 Aug 04 18:51:04
20/08/04 18:51:04 INFO util.GSet: Computing capacity for map BlocksMap
20/08/04 18:51:04 INFO util.GSet: VM type = 64-bit
20/08/04 18:51:04 INFO util.GSet: 2.0% max memory 889 MB = 17.8 MB
20/08/04 18:51:04 INFO util.GSet: capacity = 2^21 = 2097152 entries
20/08/04 18:51:05 INFO blockmanagement.BlockManager: dfs.block.access.token.enable=false
20/08/04 18:51:05 INFO blockmanagement.BlockManager: defaultReplication = 3
20/08/04 18:51:05 INFO blockmanagement.BlockManager: maxReplication = 512
20/08/04 18:51:05 INFO blockmanagement.BlockManager: minReplication = 1
20/08/04 18:51:05 INFO blockmanagement.BlockManager: maxReplicationStreams = 2
20/08/04 18:51:05 INFO blockmanagement.BlockManager: shouldCheckForEnoughRacks = false
20/08/04 18:51:05 INFO blockmanagement.BlockManager: replicationRecheckInterval = 3000
20/08/04 18:51:05 INFO blockmanagement.BlockManager: encryptDataTransfer = false
20/08/04 18:51:05 INFO blockmanagement.BlockManager: maxNumBlocksToLog = 1000
20/08/04 18:51:05 INFO namenode.FSNamesystem: fsOwner = root (auth:SIMPLE)
20/08/04 18:51:05 INFO namenode.FSNamesystem: supergroup = supergroup
20/08/04 18:51:05 INFO namenode.FSNamesystem: isPermissionEnabled = true
20/08/04 18:51:05 INFO namenode.FSNamesystem: HA Enabled: false
20/08/04 18:51:05 INFO namenode.FSNamesystem: Append Enabled: true
20/08/04 18:51:05 INFO util.GSet: Computing capacity for map INodeMap
20/08/04 18:51:05 INFO util.GSet: VM type = 64-bit
20/08/04 18:51:05 INFO util.GSet: 1.0% max memory 889 MB = 8.9 MB
20/08/04 18:51:05 INFO util.GSet: capacity = 2^20 = 1048576 entries
20/08/04 18:51:05 INFO namenode.NameNode: Caching file names occuring more than 10 times
20/08/04 18:51:05 INFO util.GSet: Computing capacity for map cachedBlocks
20/08/04 18:51:05 INFO util.GSet: VM type = 64-bit
20/08/04 18:51:05 INFO util.GSet: 0.25% max memory 889 MB = 2.2 MB
20/08/04 18:51:05 INFO util.GSet: capacity = 2^18 = 262144 entries
20/08/04 18:51:05 INFO namenode.FSNamesystem: dfs.namenode.safemode.threshold-pct = 0.9990000128746033
20/08/04 18:51:05 INFO namenode.FSNamesystem: dfs.namenode.safemode.min.datanodes = 0
20/08/04 18:51:05 INFO namenode.FSNamesystem: dfs.namenode.safemode.extension = 30000
20/08/04 18:51:05 INFO namenode.FSNamesystem: Retry cache on namenode is enabled
20/08/04 18:51:05 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis
20/08/04 18:51:05 INFO util.GSet: Computing capacity for map NameNodeRetryCache
20/08/04 18:51:05 INFO util.GSet: VM type = 64-bit
20/08/04 18:51:05 INFO util.GSet: 0.029999999329447746% max memory 889 MB = 273.1 KB
20/08/04 18:51:05 INFO util.GSet: capacity = 2^15 = 32768 entries
20/08/04 18:51:05 INFO namenode.NNConf: ACLs enabled? false
20/08/04 18:51:05 INFO namenode.NNConf: XAttrs enabled? true
20/08/04 18:51:05 INFO namenode.NNConf: Maximum size of an xattr: 16384
20/08/04 18:51:05 INFO namenode.FSImage: Allocated new BlockPoolId: BP-766871960-10.76.0.98-1596538265437
20/08/04 18:51:05 INFO common.Storage: Storage directory /usr/local/hadoop/hdfs/name has been successfully formatted.
20/08/04 18:51:05 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
20/08/04 18:51:05 INFO util.ExitUtil: Exiting with status 0
20/08/04 18:51:05 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at dev-search-01.test/10.76.0.98
************************************************************/
[root@dev-search-01 hadoop]# ll
total 56
drwxr-xr-x 2 20000 20000 4096 Nov 14 2014 bin
drwxr-xr-x 3 20000 20000 4096 Nov 14 2014 etc
drwxr-xr-x 3 root root 4096 Aug 4 18:51 hdfs
drwxr-xr-x 2 20000 20000 4096 Nov 14 2014 include
drwxr-xr-x 3 20000 20000 4096 Nov 14 2014 lib
drwxr-xr-x 2 20000 20000 4096 Nov 14 2014 libexec
-rw-r--r-- 1 20000 20000 15429 Nov 14 2014 LICENSE.txt
-rw-r--r-- 1 20000 20000 101 Nov 14 2014 NOTICE.txt
-rw-r--r-- 1 20000 20000 1366 Nov 14 2014 README.txt
drwxr-xr-x 2 20000 20000 4096 Nov 14 2014 sbin
drwxr-xr-x 4 20000 20000 4096 Nov 14 2014 share
[root@dev-search-01 hadoop]# cd hdfs/
[root@dev-search-01 hdfs]# ll
total 4
drwxr-xr-x 3 root root 4096 Aug 4 18:51 name
[root@dev-search-01 hdfs]# cd name/
[root@dev-search-01 name]# ll
total 4
drwxr-xr-x 2 root root 4096 Aug 4 18:51 current
[root@dev-search-01 name]# cd current/
[root@dev-search-01 current]# ll
total 16
-rw-r--r-- 1 root root 351 Aug 4 18:51 fsimage_0000000000000000000
-rw-r--r-- 1 root root 62 Aug 4 18:51 fsimage_0000000000000000000.md5
-rw-r--r-- 1 root root 2 Aug 4 18:51 seen_txid
-rw-r--r-- 1 root root 201 Aug 4 18:51 VERSION
[root@dev-search-01 current]#