<property>
<name>dfs.datanode.data.dir</name>
<value>/home/hadoop/data/hadoop-2.4.0</value>
<description>Determines where on the local filesystem an DFS data node
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.
Directories that do not exist are ignored.
</description>
</property>
core-site.xml里没有dfs.datanode.data.dir这个属性,安装文档是有的,我把这个属性人为加上了。
<property>
<name>dfs.datanode.data.dir</name>
<value>/home/hadoop/data/hadoop-2.4.0</value>
<description>Determines where on the local filesystem an DFS data node
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.
Directories that do not exist are ignored.
</description>
</property>
运行hadoop namenode -format 命令出现的现象:
14/08/21 08:57:02 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts; Ignoring.
14/08/21 08:57:02 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval; Ignoring.
14/08/21 08:57:02 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts; Ignoring.
14/08/21 08:57:02 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval; Ignoring.
14/08/21 08:57:02 WARN common.Util: Path /home/hadoop/dfs/hadoop-2.4.0/name should be specified as a URI in configuration files. Please update hdfs configuration.
14/08/21 08:57:02 WARN common.Util: Path /home/hadoop/dfs/hadoop-2.4.0/name should be specified as a URI in configuration files. Please update hdfs configuration.
STARTUP_MSG: build = http://svn.apache.org/repos/asf/hadoop/common -r 1583262; compiled by 'jenkins' on 2014-03-31T08:29Z
STARTUP_MSG: java = 1.7.0_67
************************************************************/
14/08/21 19:45:52 INFO namenode.NameNode: registered UNIX signal handlers for [TERM, HUP, INT]
14/08/21 19:45:52 INFO namenode.NameNode: createNameNode [-format, master]
14/08/21 19:45:53 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts; Ignoring.
14/08/21 19:45:53 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval; Ignoring.
14/08/21 19:45:53 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts; Ignoring.
14/08/21 19:45:53 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval; Ignoring.
Formatting using clusterid: CID-7a10952a-39f6-430b-9a05-daabd622fa7a
14/08/21 19:45:53 INFO namenode.FSNamesystem: fsLock is fair:true
14/08/21 19:45:53 INFO namenode.HostFileManager: read includes:
HostSet(
)
14/08/21 19:45:53 INFO namenode.HostFileManager: read excludes:
HostSet(
)
14/08/21 19:45:53 INFO blockmanagement.DatanodeManager: dfs.block.invalidate.limit=1000
14/08/21 19:45:53 INFO blockmanagement.DatanodeManager: dfs.namenode.datanode.registration.ip-hostname-check=true
14/08/21 19:45:53 INFO util.GSet: Computing capacity for map BlocksMap
14/08/21 19:45:53 INFO util.GSet: VM type = 32-bit
14/08/21 19:45:53 INFO util.GSet: 2.0% max memory 966.7 MB = 19.3 MB
14/08/21 19:45:53 INFO util.GSet: capacity = 2^22 = 4194304 entries
14/08/21 19:45:53 INFO blockmanagement.BlockManager: dfs.block.access.token.enable=false
14/08/21 19:45:53 INFO blockmanagement.BlockManager: defaultReplication = 2
14/08/21 19:45:53 INFO blockmanagement.BlockManager: maxReplication = 512
14/08/21 19:45:53 INFO blockmanagement.BlockManager: minReplication = 1
14/08/21 19:45:53 INFO blockmanagement.BlockManager: maxReplicationStreams = 2
14/08/21 19:45:53 INFO blockmanagement.BlockManager: shouldCheckForEnoughRacks = false
14/08/21 19:45:53 INFO blockmanagement.BlockManager: replicationRecheckInterval = 3000
14/08/21 19:45:53 INFO blockmanagement.BlockManager: encryptDataTransfer = false
14/08/21 19:45:53 INFO blockmanagement.BlockManager: maxNumBlocksToLog = 1000
14/08/21 19:45:53 INFO namenode.FSNamesystem: fsOwner = hadoop (auth:SIMPLE)
14/08/21 19:45:53 INFO namenode.FSNamesystem: supergroup = supergroup
14/08/21 19:45:53 INFO namenode.FSNamesystem: isPermissionEnabled = true
14/08/21 19:45:53 INFO namenode.FSNamesystem: HA Enabled: false
14/08/21 19:45:53 INFO namenode.FSNamesystem: Append Enabled: true
14/08/21 19:45:54 INFO util.GSet: Computing capacity for map INodeMap
14/08/21 19:45:54 INFO util.GSet: VM type = 32-bit
14/08/21 19:45:54 INFO util.GSet: 1.0% max memory 966.7 MB = 9.7 MB
14/08/21 19:45:54 INFO util.GSet: capacity = 2^21 = 2097152 entries
14/08/21 19:45:54 INFO namenode.NameNode: Caching file names occuring more than 10 times
14/08/21 19:45:54 INFO util.GSet: Computing capacity for map cachedBlocks
14/08/21 19:45:54 INFO util.GSet: VM type = 32-bit
14/08/21 19:45:54 INFO util.GSet: 0.25% max memory 966.7 MB = 2.4 MB
14/08/21 19:45:54 INFO util.GSet: capacity = 2^19 = 524288 entries
14/08/21 19:45:54 INFO namenode.FSNamesystem: dfs.namenode.safemode.threshold-pct = 0.9990000128746033
14/08/21 19:45:54 INFO namenode.FSNamesystem: dfs.namenode.safemode.min.datanodes = 0
14/08/21 19:45:54 INFO namenode.FSNamesystem: dfs.namenode.safemode.extension = 30000
14/08/21 19:45:54 INFO namenode.FSNamesystem: Retry cache on namenode is enabled
14/08/21 19:45:54 INFO namenode.FSNamesystem: Retry cache will use 0.03 of total heap and retry cache entry expiry time is 600000 millis
14/08/21 19:45:54 INFO util.GSet: Computing capacity for map NameNodeRetryCache
14/08/21 19:45:54 INFO util.GSet: VM type = 32-bit
14/08/21 19:45:54 INFO util.GSet: 0.029999999329447746% max memory 966.7 MB = 297.0 KB
14/08/21 19:45:54 INFO util.GSet: capacity = 2^16 = 65536 entries
14/08/21 19:45:54 INFO namenode.AclConfigFlag: ACLs enabled? false
Re-format filesystem in Storage Directory /home/hadoop/dfs/hadoop-2.4.0/name ? (Y or N) Y
14/08/21 19:45:56 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts; Ignoring.
14/08/21 19:45:56 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval; Ignoring.
14/08/21 19:45:56 INFO namenode.FSImage: Allocated new BlockPoolId: BP-698057704-192.168.1.121-1408675556549
14/08/21 19:45:56 INFO common.Storage: Storage directory /home/hadoop/dfs/hadoop-2.4.0/name has been successfully formatted.
14/08/21 19:45:57 INFO namenode.NNStorageRetentionManager: Going to retain 1 images with txid >= 0
14/08/21 19:45:57 INFO util.ExitUtil: Exiting with status 0
14/08/21 19:45:57 INFO namenode.NameNode: SHUTDOWN_MSG:
/************************************************************
SHUTDOWN_MSG: Shutting down NameNode at master/192.168.1.121
************************************************************/
[hadoop@master sbin]$
现在使用hadoop dfs -mkdir /home/hadoop/data/hadoop-2.4.0/test就name.dir目录里有文件产生。
[hadoop@master current]$ pwd
/home/hadoop/dfs/hadoop-2.4.0/name/current
[hadoop@master current]$ ls -l
total 2064
-rw-rw-r--. 1 hadoop hadoop 1048576 Aug 21 19:49 edits_0000000000000000001-0000000000000000001
-rw-rw-r--. 1 hadoop hadoop 1048576 Aug 21 19:52 edits_inprogress_0000000000000000002
-rw-rw-r--. 1 hadoop hadoop 353 Aug 21 19:45 fsimage_0000000000000000000
-rw-rw-r--. 1 hadoop hadoop 62 Aug 21 19:45 fsimage_0000000000000000000.md5
-rw-rw-r--. 1 hadoop hadoop 2 Aug 21 19:52 seen_txid
-rw-rw-r--. 1 hadoop hadoop 204 Aug 21 19:45 VERSION
[hadoop@master current]$ date
Thu Aug 21 19:57:01 PDT 2014
无文件:
[hadoop@master hadoop-2.4.0]$ pwd
/home/hadoop/tmp/hadoop-2.4.0
[hadoop@master hadoop-2.4.0]$ ls
无文件:
[hadoop@master ~]$ cd data/hadoop-2.4.0/
[hadoop@master hadoop-2.4.0]$ ls
[hadoop@master hadoop-2.4.0]$ pwd
/home/hadoop/data/hadoop-2.4.0
另外rpc-address端口号是9001还是9000?我按照论坛里的2.4.0完全分布式按照文档是9001.
-----------------------------------------------
hdfs-site.xml:
<property>
<name>dfs.datanode.data.dir</name>
<value>file:/home/hadoop/data/hadoop-2.4.0</value>
<description>Determines where on the local filesystem an DFS data node
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.
Directories that do not exist are ignored.
</description>
</property>
<property>
<name>dfs.namenode.name.dir</name>
<value>file:/home/hadoop/dfs/hadoop-2.4.0/name</value>
<description>Determines where on the local filesystem the DFS name node
should store the name table(fsimage). If this is a comma-delimited list
of directories then the name table is replicated in all of the
directories, for redundancy. </description>
</property>
<property>
<name>dfs.namenode.rpc-address</name>
<value>master:9001</value>
<description>
RPC address that handles all clients requests. In the case of HA/Federation where multiple namenodes exist,
the name service id is added to the name e.g. dfs.namenode.rpc-address.ns1
dfs.namenode.rpc-address.EXAMPLENAMESERVICE
The value of this property will take the form of nn-host1:rpc-port.
</description>
</property>
---------------------------------------------------------------------------
core-site.xml:
<property>
<name>hadoop.tmp.dir</name>
<value>file:/home/hadoop/tmp/hadoop-2.4.0</value>
<description>A base for other temporary directories.</description>
</property>
<property>
<name>fs.defaultFS</name>
<value>hdfs://master:9000</value>
<description>The name of the default file system. A URI whose
scheme and authority determine the FileSystem implementation. The
uri's scheme determines the config property (fs.SCHEME.impl) naming
the FileSystem implementation class. The uri's authority is used to
determine the host, port, etc. for a filesystem.</description>
</property>
<property>
<name>fs.default.name</name>
<value>hdfs://master:9000</value>
<description>Deprecated. Use (fs.defaultFS) property
instead</description>
</property>
[hadoop@master sbin]$ hadoop dfs -mkdir /home/hadoop/data/hadoop-2.4.0/test
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
14/08/21 20:05:40 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts; Ignoring.
14/08/21 20:05:40 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval; Ignoring.
14/08/21 20:05:41 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts; Ignoring.
14/08/21 20:05:41 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval; Ignoring.
14/08/21 20:05:41 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts; Ignoring.
14/08/21 20:05:41 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval; Ignoring.
14/08/21 20:05:41 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.attempts; Ignoring.
14/08/21 20:05:41 WARN conf.Configuration: mapred-site.xml:an attempt to override final parameter: mapreduce.job.end-notification.max.retry.interval; Ignoring.
mkdir: Call From master/192.168.1.121 to master:9000 failed on connection exception: java.net.ConnectException: Connection refused; For more details see: http://wiki.apache.org/hadoop/ConnectionRefused
[hadoop@master current]$ ls -l
total 2064
-rw-rw-r--. 1 hadoop hadoop 1048576 Aug 21 19:49 edits_0000000000000000001-0000000000000000001
-rw-rw-r--. 1 hadoop hadoop 1048576 Aug 21 19:52 edits_inprogress_0000000000000000002
-rw-rw-r--. 1 hadoop hadoop 353 Aug 21 19:45 fsimage_0000000000000000000
-rw-rw-r--. 1 hadoop hadoop 62 Aug 21 19:45 fsimage_0000000000000000000.md5
-rw-rw-r--. 1 hadoop hadoop 2 Aug 21 19:52 seen_txid
-rw-rw-r--. 1 hadoop hadoop 204 Aug 21 19:45 VERSION
[hadoop@master current]$ date
Thu Aug 21 20:06:18 PDT 2014