2015-03-30 93 views
0

我試圖讀取以檢查HDFS上是否存在文件。我使用的是Eclipse IDE,並且在類路徑中具有所有必需的hadoop jar和hadoop配置。當我執行程序時,我看到下面的異常。無法創建代理提供程序類org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider

Configuration conf = new Configuration(true); 
     conf.addResource(new File("core-site.xml").toURI().toURL()); 
     conf.addResource(new File("hdfs-site.xml").toURI().toURL()); 
     conf.addResource(new File("mapred-site.xml").toURI().toURL()); 
     FileSystem hdfs = FileSystem.get(conf); 
     boolean isExists = hdfs.exists(source); 

異常: 產生java.io.IOException:在org.apache.hadoop.hdfs.server無法創建代理提供一流org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider 。 namenode.ha.ConfiguredFailoverProxyProvider(ConfiguredFailoverProxyProvider.java:93) 在sun.reflect.NativeConstructorAccessorImpl.newInstance0(本機方法) 在sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

誰能幫助我解決這個問題?

回答

0

dfs.client.failover.proxy.provider。 您的集羣名 org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider

這應該是你的集羣名稱,我想這也是區分大小寫。

相關問題