在linux(2台)部署了分布式hdfs,windows做客户端测试发现2个
1、org.apache.hadoop.hdfs.protocol.AlreadyBeingCreatedException: failed to create file /test/a for DFSClient_1846787155 on client 10.4.67.106 because current leaseholder is trying to recreate file.
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.startFileInternal(FSNamesystem.java:1045)
at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.startFile(FSNamesystem.java:981)
at org.apache.hadoop.hdfs.server.namenode.NameNode.create(NameNode.java:377)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:508)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:959)
at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:955)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.ipc.Server$Handler.run(Server.java:953)
2、客户端运行很慢,程序如下,
Configuration.addDefaultResource("core-site.xml");
Configuration conf = new Configuration();
conf.set("fs.file.impl", "org.apache.hadoop.fs.LocalFileSystem");
conf.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem");
conf.set("fs.default.name", "hdfs://10.1.148.170:9000");
conf.writeXml(System.out);
FileSystem fs = FileSystem.get(conf);
if(true) {
//fs.mkdirs(new Path("/test"));
fs.create(new Path("/test/a"));
fs.copyFromLocalFile(new Path("file:///D:/eclipse/workspace/Hadoop/src/org/apache/hadoop/test/abc"), new Path("/test/a"));
}
请问各位大侠什么原因吗? |
|