• 注册
当前位置:1313e > 默认分类 >正文

hdfs配置多块硬盘存储

datanode配置多个数据存储地址,涉及到以下两个配置项

dfs.name.dir

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.

这个参数用于确定将HDFS文件系统的元信息保存在什么目录下。

如果这个参数设置为多个目录,那么这些目录下都保存着元信息的多个备份。

如:

dfs.name.dir/pvdata/hadoopdata/name/,/opt/hadoopdata/name/

dfs.data.dir 

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.

这个参数用于确定将HDFS文件系统的数据保存在什么目录下。

我们可以将这个参数设置为多个分区上目录,即可将HDFS建立在不同分区上。

如:

dfs.data.dir/dev/sda3/hadoopdata/,/dev/sda1/hadoopdata/

此外,多个硬盘进行数据存储时,还可以进行写入策略的配置。

如:

dfs.datanode.fsdataset.volume.choosing.policyorg.apache.hadoop.hdfs.server.datanode.fsdataset.AvailableSpaceVolumeChoosingPolicy

多硬盘存放策略参考另一篇博客《HDFS 副本存放磁盘选择策略详解》

本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 162202241@qq.com 举报,一经查实,本站将立刻删除。

最新评论

欢迎您发表评论:

请登录之后再进行评论

登录