Hadoop集群管理 Namenode的目录数据结构

一、dfs目录结构

[root@master hadoop]# pwd
/opt/hadoop-2.7.1/etc/hadoop

[root@master hadoop]# cat core-site.xml 
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
  Licensed 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. See accompanying LICENSE file.
-->

<!-- Put site-specific property overrides in this file. -->

<configuration>
	<property>
		<name>hadoop.tmp.dir</name>
		<value>/opt/hadoop-2.7.1/tmp</value>
	</property>
	<property>
		<name>fs.defaultFS</name>
		<value>hdfs://master.harry.com:9000</value>
	</property>
	
	<!-- HA-->
<!--
	<property>
		<name>ha.zookeeper.quorum</name>
		<value>master.harry.com:2181</value>
	</property>
	<property>
		<name>ha.zookeeper.session-timeout.ms</name>
		<value>5000</value>
	</property>
	<property>
		<name>ha.zookeeper.parent-znode</name>
		<value>/hadoop-harry-ha</value>
	</property>
-->
</configuration>


[root@master tmp]# pwd
/opt/hadoop-2.7.1/tmp

[root@master tmp]# tree dfs/ -L 2
dfs/
|-- data
|   `-- current
`-- name
    `-- current

4 directories, 0 files

[root@master current]# pwd
/opt/hadoop-2.7.1/tmp/dfs/name/current

[root@master current]# ll
total 1076
-rw-r--r--. 1 root root     207 Oct 14 22:39 VERSION
-rw-r--r--. 1 root root   14381 Oct 14 23:33 edits_0000000000000000001-0000000000000000127
-rw-r--r--. 1 root root      42 Oct 15 00:33 edits_0000000000000000128-0000000000000000129
-rw-r--r--. 1 root root      42 Oct 15 01:33 edits_0000000000000000130-0000000000000000131
-rw-r--r--. 1 root root      42 Oct 15 02:33 edits_0000000000000000132-0000000000000000133
-rw-r--r--. 1 root root 1048576 Oct 15 02:33 edits_inprogress_0000000000000000134
-rw-r--r--. 1 root root    1809 Oct 15 01:33 fsimage_0000000000000000131
-rw-r--r--. 1 root root      62 Oct 15 01:33 fsimage_0000000000000000131.md5
-rw-r--r--. 1 root root    1809 Oct 15 02:33 fsimage_0000000000000000133
-rw-r--r--. 1 root root      62 Oct 15 02:33 fsimage_0000000000000000133.md5
-rw-r--r--. 1 root root       4 Oct 15 02:33 seen_txid

二、解析

edits_* 文件:当我们对元数据进行修改时,如新增了block,新增了节点,等等,这样对namespace等进行了修改,数据都会被临时存放到edits文件中。


fsimage 文件:存放实际的namenode所管理的数据。定期的由secondary namenode和并edits文件和旧的fsimage文件而成的。

seen_txid:记录最后一个edits文件的数字如 本例子中式134.因为edits文件最后到133.当系统重启时,会检查seen_txid和edits文件的最后数字,来表示是否存在元数据的缺失。

[root@master current]# cat seen_txid 
134

VERSION文件:

[root@master current]# cat VERSION 
#Wed Oct 14 22:39:48 PDT 2015
namespaceID=1916027777
clusterID=CID-f0ee4204-f7a1-4e8d-9799-bdd5e23259f1
cTime=0
storageType=NAME_NODE
blockpoolID=BP-1637593683-172.16.114.202-1444887588098
layoutVersion=-63


转载于:https://my.oschina.net/u/204498/blog/518758

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值