hdfs:上传后文件未分发

dz6r00yl  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(359)

我已经在8节点集群上部署了hadoop(0.20.203.0rc1)。在上传文件到hdfs之后,我只在一个节点上得到了这个文件,而不是均匀地分布在所有节点上。有什么问题吗?

  1. $HADOOP_HOME/bin/hadoop dfs -copyFromLocal ../data/rmat-20.0 /user/frolo/input/rmat-20.0
  2. $HADOOP_HOME/bin/hadoop dfs -stat "%b %o %r %n" /user/frolo/input/rmat-*
  3. 1220222968 67108864 1 rmat-20.0
  4. $HADOOP_HOME/bin/hadoop dfsadmin -report
  5. Configured Capacity: 2536563998720 (2.31 TB)
  6. Present Capacity: 1642543419392 (1.49 TB)
  7. DFS Remaining: 1641312030720 (1.49 TB)
  8. DFS Used: 1231388672 (1.15 GB)
  9. DFS Used%: 0.07%
  10. Under replicated blocks: 0
  11. Blocks with corrupt replicas: 0
  12. Missing blocks: 0
  13. -------------------------------------------------
  14. Datanodes available: 8 (8 total, 0 dead)
  15. Name: 10.10.1.15:50010
  16. Decommission Status : Normal
  17. Configured Capacity: 317070499840 (295.29 GB)
  18. DFS Used: 24576 (24 KB)
  19. Non DFS Used: 131536928768 (122.5 GB)
  20. DFS Remaining: 185533546496(172.79 GB)
  21. DFS Used%: 0%
  22. DFS Remaining%: 58.51%
  23. Last contact: Fri Feb 07 12:10:27 MSK 2014
  24. Name: 10.10.1.13:50010
  25. Decommission Status : Normal
  26. Configured Capacity: 317070499840 (295.29 GB)
  27. DFS Used: 24576 (24 KB)
  28. Non DFS Used: 131533377536 (122.5 GB)
  29. DFS Remaining: 185537097728(172.79 GB)
  30. DFS Used%: 0%
  31. DFS Remaining%: 58.52%
  32. Last contact: Fri Feb 07 12:10:27 MSK 2014
  33. Name: 10.10.1.17:50010
  34. Decommission Status : Normal
  35. Configured Capacity: 317070499840 (295.29 GB)
  36. DFS Used: 24576 (24 KB)
  37. Non DFS Used: 120023924736 (111.78 GB)
  38. DFS Remaining: 197046550528(183.51 GB)
  39. DFS Used%: 0%
  40. DFS Remaining%: 62.15%
  41. Last contact: Fri Feb 07 12:10:27 MSK 2014
  42. Name: 10.10.1.18:50010
  43. Decommission Status : Normal
  44. Configured Capacity: 317070499840 (295.29 GB)
  45. DFS Used: 24576 (24 KB)
  46. Non DFS Used: 78510628864 (73.12 GB)
  47. DFS Remaining: 238559846400(222.18 GB)
  48. DFS Used%: 0%
  49. DFS Remaining%: 75.24%
  50. Last contact: Fri Feb 07 12:10:24 MSK 2014
  51. Name: 10.10.1.14:50010
  52. Decommission Status : Normal
  53. Configured Capacity: 317070499840 (295.29 GB)
  54. DFS Used: 24576 (24 KB)
  55. Non DFS Used: 131537530880 (122.5 GB)
  56. DFS Remaining: 185532944384(172.79 GB)
  57. DFS Used%: 0%
  58. DFS Remaining%: 58.51%
  59. Last contact: Fri Feb 07 12:10:27 MSK 2014
  60. Name: 10.10.1.11:50010
  61. Decommission Status : Normal
  62. Configured Capacity: 317070499840 (295.29 GB)
  63. DFS Used: 1231216640 (1.15 GB)
  64. Non DFS Used: 84698116096 (78.88 GB)
  65. DFS Remaining: 231141167104(215.27 GB)
  66. DFS Used%: 0.39%
  67. DFS Remaining%: 72.9%
  68. Last contact: Fri Feb 07 12:10:24 MSK 2014
  69. Name: 10.10.1.16:50010
  70. Decommission Status : Normal
  71. Configured Capacity: 317070499840 (295.29 GB)
  72. DFS Used: 24576 (24 KB)
  73. Non DFS Used: 131537494016 (122.5 GB)
  74. DFS Remaining: 185532981248(172.79 GB)
  75. DFS Used%: 0%
  76. DFS Remaining%: 58.51%
  77. Last contact: Fri Feb 07 12:10:27 MSK 2014
  78. Name: 10.10.1.12:50010
  79. Decommission Status : Normal
  80. Configured Capacity: 317070499840 (295.29 GB)
  81. DFS Used: 24576 (24 KB)
  82. Non DFS Used: 84642578432 (78.83 GB)
  83. DFS Remaining: 232427896832(216.47 GB)
  84. DFS Used%: 0%
  85. DFS Remaining%: 73.3%
  86. Last contact: Fri Feb 07 12:10:27 MSK 2014
fbcarpbf

fbcarpbf1#

您的文件已使用复制因子写入 1 ,你的 hadoop fs -stat 命令输出。这意味着文件下的块将只存在一个块副本。
写入的默认复制因子由属性控制 dfs.replication 低于 $HADOOP_HOME/conf/hdfs-site.xml . 如果未指定,则默认为 3 ,但很可能指定了它的重写,其值为 1 . 将其值更改回 3 或者完全删除它(调用默认值)将使所有新的文件写入都使用 3 默认情况下为复制副本。
您还可以使用 -D 属性支持的属性传递方法 hadoop fs 实用程序,例如: hadoop fs -Ddfs.replication=3 -copyFromLocal ../data/rmat-20.0 /user/frolo/input/rmat-20.0 您可以使用 hadoop fs -setrep 实用程序,例如: hadoop fs -setrep 3 -w /user/frolo/input/rmat-20.0 带有 HDFS 复制因子大于 1 将显示自动分布在多个节点上。 HDFS 决不会将一个块的多个副本写入同一块 DataNode .

相关问题