在不同的hadoop节点上添加不同的文件

发布于 2024-12-21 01:43:17 字数 261 浏览 5 评论 0原文

当我们添加文件时

bin/hadoop dfs -put input_folder 输入

通过该命令输入到 HDFS 中。 当我们添加文件时,它们会被复制到所有节点。

有什么方法可以让我们在不同的节点上分发不同的文件,这意味着假设我有 4 个文件 A、B、C、DI 将在节点 1 上添加文件 A 和 B,并保留在节点 2 上。 这种情况可能吗?

如果是,那么如果节点发生故障会发生什么?

When we add files with

bin/hadoop dfs -put input_folder input

by this command in HDFS.
When we add files , they are replicated to all the nodes.

Is there any way by which we can distribute different files on different nodes , means suppose i have 4 file A,B,C,D.I will add file A and B on node 1 and remaining on node 2.
Is this scenario possible?

If yes then what happens in case of node failure?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

相思故 2024-12-28 01:43:17

我假设您没有更改复制因子。默认值为 3,这意味着每个文件有三个副本。如果您有 2 个数据节点,则所有文件都将复制到所有数据节点。减小该值直到满足您的需要。

<property>
    <name>dfs.replication</name>
    <value>1</value>
</property>

如果节点发生故障并且不存在其他副本,您将无法访问这些文件

I assume that you have not changed your replication factor. The default is 3 which means you have three replica from each file. if you have 2 data nodes all files will be replicated to all data nodes. decrease this value until it fits your needs.

<property>
    <name>dfs.replication</name>
    <value>1</value>
</property>

If nodes fails and no other replicas exists, You can not access those files

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文