`
zhaomengsen
  • 浏览: 212056 次
  • 性别: Icon_minigender_1
  • 来自: 河北
社区版块
存档分类
最新评论

HDFS如何使用多个磁盘

 
阅读更多
dfs.name.dir 与 dfs.data.dir
dfs.name.dir 备多份
dfs.data.dir 轮循




1 fs.default.name
To run HDFS, you need to designate (指派)one machine as a namenode. In this case, the
property fs.default.name is a HDFS filesystem URI, whose host is the namenode’s
hostname or IP address, and port is the port that the namenode will listen on for RPCs.
If no port is specified, the default of 8020 is used.
The fs.default.name property also doubles as specifying the default filesystem. The
default filesystem is used to resolve relative paths, which are handy (有用)to use since they
save typing (and avoid hardcoding knowledge of a particular namenode’s address). For
example, with the default filesystem defined in Example 9-1, the relative URI /a/b is
resolved to hdfs://namenode/a/b.

2 dfs.name.dir



  here are a few other configuration properties you should set for HDFS: those that set
the storage directories for the namenode and for datanodes. The property
dfs.name.dir specifies a list of directories where the namenode stores persistent file-
system metadata (the edit log, and the filesystem image). A copy of each of the metadata
files is stored in each directory for redundancy( 冗余,即namenode在 dfs.name.dir 每一 项位置中存的数据都是一样的 ) .

It’s common to configure dfs.name.dir so that the namenode metadata is written to one or two local disks , and
a remote disk , such as a NFS-mounted directory. Such a setup guards against failure
of a local disk, and failure of the entire namenode, since in both cases the files can be
recovered and used to start a new namenode. (The secondary namenode takes only
periodic checkpoints of the namenode, so it does not provide an up-to-date backup of
the namenode.)


3 dfs.data.dir



You should also set the dfs.data.dir property, which specifies a list of directorie s for
a datanode to store its blocks. Unlike the namenode, which uses multiple directories
for redundancy(冗余), a datanode round-robins(轮循, datanode 在 dfs.data.dir 每一 项位置中存的数据是不一样的 ) . ) writes between its storage directories, so for
performance you should specify a storage directory for each local disk. Read perform-
ance also benefits from having multiple disks for storage, because blocks will be spread
across them, and concurrent reads for distinct blocks will be correspondingly spread
across disks.

4 fs.checkpoint.dir

Finally, you should configure where the secondary namenode stores its checkpoints of
the filesystem. The fs.checkpoint.dir property specifies a list of directories where the
checkpoints are kept. Like the storage directories for the namenode, which keep re-
dundant copies of the namenode metadata, the checkpointed filesystem image is stored
in each checkpoint directory for redundancy.

Note that the storage directories for HDFS are under Hadoop’s tempo-
rary directory by default (the hadoop.tmp.dir property, whose default
is /tmp/hadoop-${user.name}). Therefore it is critical that these proper-
ties are set so that data is not lost by the system clearing out temporary
directories.
分享到:
评论

相关推荐

    HDFS可靠性策略

    FSImage(文件系统镜像)和 Editlog(操作日志)可以多份存储,还可以设置存储在多个磁盘上,一旦一块磁盘坏掉,其他磁盘还有备份。FSImage 和 Editlog 会定期合并形成新的 FSimage,然后清空 Editlog 文件。 主备 ...

    hdfs安装手册

    HDFS是一个master-slave架构的分布式文件系统,由一个NameNode和多个DataNode组成。NameNode负责存储文件系统的元数据,而DataNode负责存储实际的数据块。 4. HDFS 安装部署 HDFS的安装部署可以分为以下几个步骤:...

    在HDFS上使用Lucene的SourceCode

    2. 使用`FileSplit`将文件分成多个部分,然后在每个`MapReduce`任务中处理一部分。 3. 在`Mapper`阶段,读取每个分片的内容,创建`Document`对象,并添加到`IndexWriter`中,就像在本地文件系统上一样。 4. 在`...

    HDFS部署与Shell命令使用

    - `<percentageofdiskcapacity>`:表示HDFS达到平衡状态的磁盘使用率偏差值。 - **值越低**:表示各节点之间的磁盘使用率差异越小,但可能需要更多的时间来完成数据平衡操作。 #### 总结 通过对HDFS的不同部署...

    面向HDFS的多层索引技术

    这种索引结构可以在多个层次上对数据进行预处理,使得查询可以在较短时间内定位到目标数据块,从而减少不必要的磁盘I/O和网络传输。具体来说,索引可以分为粗粒度和细粒度两层,粗粒度索引用于快速过滤大量数据,而...

    HDFS文件读写操作

    3. **文件切分**:客户端接收到NameNode的确认信息后,会将大文件切分为多个较小的数据块(默认大小为128MB)。每个数据块都会被复制多份,通常默认为三份,以提高数据的可靠性。 4. **确定DataNode**:NameNode会...

    《HDFS——Hadoop分布式文件系统深度实践》PDF

    HDFS的设计目标是支持大规模数据集的存储,它采用了主从结构(Master-Slave架构),由一个NameNode作为主节点管理元数据,多个DataNode作为从节点存储实际的数据块。NameNode负责维护文件系统的命名空间和文件块信息...

    HDFS的ssh操作.docx

    - 高容错性:HDFS通过在多个DataNode上复制数据块的方式保证数据的可靠性和可用性。 - 可扩展性强:可以轻松地添加更多的DataNode来扩大存储容量。 - 大数据支持:特别适合存储和处理大规模数据集。 - **缺点**:...

    HDFS集中式缓存

    4. **内存使用率的提升**:相比于依赖于每个DataNode的操作系统缓冲机制,集中式缓存管理可以避免同一块数据的多个副本都被缓存,从而节省大量的内存资源。 #### 三、使用场景 - **重复访问的文件**:例如Hive中的...

    大数据HDFS文档

    - **分布式存储**: 数据被分割成Block(块)后分布存储在网络中的多个节点上。 - **主从结构**: HDFS采用主从(Master-Slave)架构,其中NameNode作为主节点负责管理文件系统的命名空间和客户端对文件的访问;...

    HDFS构架设计和读写流程.docx

    - **块的分布**:通过将文件划分为多个块并分布在多个DataNode上,HDFS实现了良好的负载均衡。 #### NameNode中的元信息 - **文件和目录信息**:包括文件和目录的名称、所有者、权限等。 - **文件块信息**:每个...

    7_尚硅谷大数据之HDFS概述1

    HDFS 概述及架构 HDFS(Hadoop Distributed File System)是一种分布式文件管理系统,用于存储和管理大规模数据。...如果块设置得足够大,从磁盘传输数据的时间会明显大于定位这个块开始位置所需的时间。

    HDFS常见问题维护手册V1.01

    总之,HDFS的维护涉及多个层面,从理解其基本架构、熟练掌握客户端工具,到监控系统状态和日志分析,都是保障HDFS高效运行的关键。了解并掌握这些知识,将有助于解决在使用HDFS过程中可能出现的各种问题。

    《Hadoop大数据开发实战》教学教案—03HDFS分布式文件系统.pdf

    HDFS(Hadoop Distributed File System,Hadoop 分布式文件系统)是一种通过网络实现文件在多台主机上进行分布式存储的文件系统。分布式存储比普通存储方式节省时间。HDFS 由 NDFS 系统演变而来,主要解决海量大数据...

    分布式文件系统和HDFS那点事

    - **数据块的存储**:每个HDFS文件会被分割成多个数据块,默认情况下,每个数据块的大小为128MB。DataNode将这些数据块存储在本地文件系统中,并且不会将所有文件都放在同一个目录下,而是采用启发式算法来确定最...

    Facebook开发HDFS和HBase的新进展

    2. **Federation支持**:为了应对数据存储规模的增长,Facebook实现了NameNode的Federation架构,允许数据跨多个NameNode分布,有效提升了系统的可扩展性和存储容量。 3. **RAID存储优化**:Facebook引入了基于Reed...

    HDFS可视化操作研究与实现

    HDFS充分利用了集群中的多台机器,将大型数据集分割成多个块,并将这些块复制到不同的节点上,以提供高可用性和容错性。在HDFS中,数据的完整性通过数据块的复制机制得以保障,通常每个数据块都有多个副本,以防止单...

    浪潮简介HDFS

    Hadoop Distributed File System (HDFS) 是Apache Hadoop项目的核心组件之一,是一个分布式文件系统,设计用于处理和存储大量数据。HDFS具有高容错性和高吞吐量的特点,非常适合在大规模集群环境中运行。以下是对...

    hadoop日记2.1:hdfs设计思想和基础概念

    为了容错,HDFS会为每个数据块创建多个副本,并将这些副本存储在不同的节点上。这种分布式的存储方式不仅提高了数据的可靠性,还使得系统能够在某个节点出现故障时迅速恢复数据的可用性。通过这种方式,HDFS能够有效...

Global site tag (gtag.js) - Google Analytics