Open Researcher86 opened 6 years ago
I also encountered this problem. in hadoop-docker2.7.1 and hadoop 2.9.1. Have you solved it? How to solve it? Thank You.
my envs:hadoop-docker 2.7.0 hadoop 2.7.0 MacOS 10.14
I also encountered this problem , but I solved it according to the following steps.
vi MacOS /etc/hosts add {host machine ip} {hadoop-docker hostname}
touch a hdfs-site.xml, then add it in your java code
<configuration>
<property>
<name>dfs.replication</name>
<value>1</value>
</property>
<property>
<name>dfs.client.use.datanode.hostname</name>
<value>true</value>
</property>
<property>
<name>dfs.datanode.use.datanode.hostname</name>
<value>true</value>
</property>
</configuration>
conf.addResource(new Path("/Users/mac/IdeaProjects/playgroup/hdfs-site.xml"));
Error writing file
Run
App
error
what am I doing wrong?