-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java 如何访问docker中的hdfs? #60
Comments
不要动脚本,脚本里配置好了, <?xml version="1.0"?>
<configuration>
<property>
<name>fs.defaultFS</name>
<value>hdfs://hadoop-master:9000/</value>
</property>
</configuration> 你只要访问 主机地址:9000就行 |
同问,我看启动参数只暴露出8088和50070,宿主机上是如何能访问到9000的端口的呢?主机地址:9000试了下 显示连接被拒绝 |
同问,windows下,无法通过python的hdfs模块访问HDFS,即便我加了对9000端口的映射。
这是python测试客户端:
这是报错:
|
同楼上一样的问题 |
请问这个项目是只能测试wordcount还是能进一步开发,用hadoop完成一些别的工作? |
请问 我想通过java来操作hdfs
FileSystem fs = FileSystem.get(new URI("hdfs://172.18.0.2:9000/"), configuration, "root"); System.out.println("begin copy"); fs.copyFromLocalFile(new Path("/Users/xxx/apps/test/test.log"), new Path("/")); System.out.println("done!");
用hadoop上master上的ip 没法在hdfs上创建文件
我仿照脚本加上了一个 0.0.0.0:9000 -> 9000/tcp 冲宿主机上映射到hadoop-master上的9000端口,hdfs://localhost:9000/ 发现虽然能创建文件但size是0
请教一下,谢谢!
The text was updated successfully, but these errors were encountered: