在不同的hadoop节点上添加不同的文件
当我们添加文件时
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您没有更改复制因子。默认值为 3,这意味着每个文件有三个副本。如果您有 2 个数据节点,则所有文件都将复制到所有数据节点。减小该值直到满足您的需要。
如果节点发生故障并且不存在其他副本,您将无法访问这些文件
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.
If nodes fails and no other replicas exists, You can not access those files