简体   繁体   English

Hadoop Docker 容器只能复制到 0 个节点而不是 minReplication (=1)

[英]Hadoop Docker container could only be replicated to 0 nodes instead of minReplication (=1)

I tried different docker images for Hadoop containers but none of them work when I try to write files to HDFS.我为 Hadoop 容器尝试了不同的 docker 图像,但是当我尝试将文件写入 HDFS 时,它们都不起作用。 I always get error:我总是得到错误:

Caused by: org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /t/_temporary/0/_temporary/attempt_20200528153700_0001_m_000006_7/part-00006-34c8bc6d-68a3-4177-bfbf-5f225b28c157-c000.snappy.parquet could only be replicated to 0 nodes instead of minReplication (=1). Caused by: org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /t/_temporary/0/_temporary/attempt_20200528153700_0001_m_000006_7/part-00006-34c8bc6d-68a3-4177-bfbf-5f225b28c157-c000.snappy. parquet 只能复制到 0 个节点而不是 minReplication (=1)。 There are 3 datanode(s) running and 3 node(s) are excluded in this operation.有 3 个数据节点正在运行,并且在此操作中排除了 3 个节点。

What I tried so far?到目前为止我尝试了什么?

  1. Formatted Namenode as mentioned under similar questions.类似问题中提到的格式化Namenode。
  2. Exposed needed ports, 8088, 50070, 9000, 50010.暴露需要的端口,8088、50070、9000、50010。
  3. Already have enough space in Datanode. Datanode 中已经有足够的空间。
  4. Updated host file, mapped 127.0.0.1 to container name.更新主机文件,将 127.0.0.1 映射到容器名称。

I'm running app on my local computer, Docker containers running on local as well.我在本地计算机上运行应用程序,Docker 容器也在本地运行。

After creating basic Dataframe, I'm trying to write.创建基本的 Dataframe 后,我正在尝试编写。

df.write.save('hdfs://hadoop-master:9000/t', format='parquet', mode='append'

It took almost 2 minutes, then throws error.花了将近2分钟,然后抛出错误。

WebUI is fine.网页界面很好。 I can put file to HDFS with commands in container.我可以使用容器中的命令将文件放入 HDFS。

It seems like network/connection problem to me, but couldn't find out.对我来说似乎是网络/连接问题,但找不到。

I didn't solve problem but found a quick solution.我没有解决问题,但找到了一个快速的解决方案。

TL;TR TL;TR

MacOS may cause this problem. MacOS 可能会导致此问题。

Built new Debian server on GCP, installed docker, its images and Python codes which I tested.在 GCP 上构建了新的 Debian 服务器,安装了 docker,它的图像和我测试过的 Python 代码。 It worked fine, but still I am getting error when I try to connect from my local machine.它工作正常,但是当我尝试从本地计算机连接时仍然出现错误。

But still need an answer, I share it for someone who needs quick solution.但仍然需要一个答案,我分享给需要快速解决方案的人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM